Answer the question
In order to leave comments, you need to log in
How to query sqlite3 from command line (bash)?
Good afternoon!
I will briefly describe the essence of the task, maybe I chose too cycling option:
There is a shell script that overtakes the database from mysql to sqlite3, only the database structure.
Next, I need to manually remove "extra" fields and tables from the database. And I want to automate this process.
The idea is to run queries to delete fields and tables after converting the database to sqlite.
But I cannot understand or find information on how to query the database from the main console (or script).
Mysql has, for example, such a variant
mysql -u Username -p base -e "SELECT * FROM test_table"
Is there something similar in sqlite3?
Perhaps there are better ways to solve this problem?
Answer the question
In order to leave comments, you need to log in
sqlite3 db.sqlite 'select * from test_table'
or
echo 'select * from test_table;'| sqlite3 asd.sqlite
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question