.(dot) character is not being accepted in database name |
CodeIgniter 4.02 version
Direction set databasename in .env file. for example Code: database.default.hostname = localhost Created : users table PHP Code: <?php namespace App\Database\Migrations; Describe the bug Code: E:\work\htdocs\ci4\public>php spark migrate Expected behavior .(dot) character should be allowed in database.default.database
Strictly speaking, dot character in database names might not be supported by all database engines and versions. Indeed it is supported in latest mySQL/MariaDB, but it was not like that before: https://dev.mysql.com/doc/refman/8.0/en/...fiers.html
Also, dot character is used in fully qualified names (my_db.my_table.my_column), that should be quoted separately: `my_db`.`my_table`.`my_column`. This is exactly wha CI4 is doing when finds a dot in DB config: treats it as a qualifier separator, and quotes parts before and after it separately. Interesting thought, that database name in mySQL does not have a qualifier - this is covered in docs, https://dev.mysql.com/doc/refman/8.0/en/...fiers.html However, in other DB engines (e.g. MS SQL, Oracle come to my mind) situation might be different: my_server.my_db.my_schema for instance. So we could change it for particular DB Driver, if it makes sense at all. (03-12-2020, 07:05 AM)zahhar Wrote: Strictly speaking, dot character in database names might not be supported by all database engines and versions. Indeed it is supported in latest mySQL/MariaDB, but it was not like that before: https://dev.mysql.com/doc/refman/8.0/en/...fiers.htmlthanks for the reply. i got your point. i am using maria db with codeigniter 4. here this point needs to remember that in codeigniter 3 version dot character is allowed in db name, while in codeigniter 4 is not being accpted. |
Welcome Guest, Not a member yet? Register Sign In |