Reputation: 239
Very basic question, having a hard time finding an explanation online.
I have a file code.sql that can be run on two different databases, a.db3 and b.db3. I used sqlite a.db3 to open the database in sqlite3. How do I run code.sql on it?
Upvotes: 2
Views: 2246
Reputation: 352
Use DB Browser for SQLite is a high quality, visual, open source tool to create, design, and edit database files compatible with SQLite.
You can download the DB Browser at SQLite https://sqlitebrowser.org/
Upvotes: 0
Reputation: 20472
I am guessing that you are trying to use the sqlite3 command line tool that you can dowload from the sqlite.org website.
I recomend that you use, instead, sqlitestudio http://sqlitestudio.one.pl
This has a feature to execute SQL from a file on a database:
Upvotes: 0
Reputation: 180060
Use the .read code.sql
command, or call sqlite3
with the file as input: sqlite3 a.db3 < code.sql
.
Upvotes: 3