I'm trying to autogenerate my data models on sequelize for SQLite using squelize-auto on Windows. I have created my sqlite file with schema only, no data inside. Also installed everything as indicated here.
The command I'm using looks like this:
sequelize-auto -h localhost -u dontcare -d "E:\full\path\to\my\database.db" --dialect sqlite
Also tried with some other path styles like './database.db' etc.
And this is the answer I'm getting:
Executing (default): SELECT name FROM `sqlite_master` WHERE type='table' and name!='sqlite_sequence';
Done!
After this, the script creates a folder called "models" with nothing inside.
Does somebody know what's happening here?
Many thanks!
I've found the problem: -d should be the database name, not the path to the file. For specify the file path, you should use the option -c indicating a JSON file. The storage attribute finally indicates that path. The command should looks like this:
sequelize-auto -h localhost -u dontcare -d databasename --dialect sqlite -c options.json
And options.json looks like this:
{
"storage":"./database_file_name.db"
}
I hope this will be useful to someone. Bye!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With