Closed jasonlaw closed 2 years ago
Some extra information, I am using MySQL database.
Here is my connection string settings: "ConnectString": "Server= xx.xx.xx.xx; Port= 3306; Uid= xx; Pwd= xx; Old Guids= true; SslMode= none; CharSet=utf8mb4;"
Notes there isn't the Database parameter. The reason is the database may not be created yet. By providing the Database parameter, the framework will hit an error if the database is not found.
I absolutely don't get it, what's the problem and how you suggest the system SHOULD behave. You say "the reason is the database my not be created yet" - so the system behaves as expected, reporting 'no database selected' - maybe because it does not exist?! what you want me to do? I say everywhere in docs, fwk DOES NOT create database, it covers everything else like creating entire schema. This is intentional. So the main premise the database must exist, that's it.
btw, first thing to do - copy paste err message to google, add MySQL, and search, when it happens. as far as I remember MySQL does not have databases, only schemas
Alright, I think I had misunderstand that the framework will create the database when it doesn't exists, since it really does in the testing with SQLite, with the database parameter in the connection string. It is my bad to confuse with the database schema and database itself, sorry about it.
For the issue, I have found the solution for it, by just appending the database name as prefix to the table, example, MyDatabase.UnitDefaultOwner, then it will works like a charm.
Really appreciate it for such a cool framework! Thanks!
Hi @rivantsov ,
The following code hit error with "No database selected".
May I know what am I missing here?
Thanks in advance.