SQLite is a serverless embedded database that reads and writes to a file. You can read more about it on their site
List of Commands
You can see a list of commands with the .help command:
$ echo .help | sqlite3
or from within sqlite3 command line shell:
Use a SQLite Database
$ sqlite3 /path/to/database_file.db
This will make your instance of sqlite use the database in the .db file. It's also how to "open" the file and start using it in SQLite.
View Schema Structure
$ echo .schema | sqlite3 /path/to/my_sqlite_file.db
$ sqlite3 my_sqlite_file.db
sqlite> .output /path/to/my_outputfile.sql
Note that the syntax of this SQL file will not work for MySQL, but it will be close. Some finding and replacing should put it in the correct format.
In particular, you will need to remove double-quotes in CREATE TABLE statements. If the column names in the create statement have spaces in them, you'll need to surround the name with backticks
(`) NOT single-quotes.
CREATE TABLE IF NOT EXISTS "Misc"("Part Number" varchar(255),"Part Type" varchar(255),"Value" varchar(255));
CREATE TABLE IF NOT EXISTS Misc(`Part Number` varchar(255),`Part Type` varchar(255),Value varchar(255));
- 05 Mar 2018