You can generate .SQLite file from .SQL file by using SQLite-CLI. For that purpose, you need to prepare some gears as the following.
2. Sqlite Tool for Windows (Command Line Tools)
You can download all needs from here.
After you download the items, you need to extract them into a directory for example "C:\\sqlite". Now, in you directory, you will have sqldiff.exe, sqlite3.def, sqlite3.dll, sqlite3.exe, and sqlite3_analyzer.eze.
Next, you should add "C:\\sqlite" or your own location into PATH data in Windows environment variable so you can access "sqlite3.exe" from command prompt without full path declaration. In command prompt you can type sqlite3 then the following messages will appear.
Now, you are in SQLite command terminal. First, you need to open the SQL file. Your opened file will be assigned into an in-memory database. Then you can save that in-memory database into a SQLite file. Before you open the SQL file, you need to make sure that the file doesn't contain specific database syntax or symbol which SQLite doesn't recognize. For example in SQL file from MySQL, that can be ENGINE, SET, etc. The commands are as following.
For other commands you can check sqlite help by
SQLite Messages |
sqlite> .read mydb.sql
sqlite> .save mydb.sqlite
For other commands you can check sqlite help by
sqlite> .help
Comments
Post a Comment