-
Notifications
You must be signed in to change notification settings - Fork 0
sqlite
E. Lynette Rayle edited this page Mar 9, 2023
·
3 revisions
Start CLI:
sqlite3 _DBNAME_.sqlite
Exit CLI:
<CTRL><D>
(no longer seem to have this installed)
NOTE: Chrome has a viewer built in. Drag the *.sqlite file into an empty browser window and it will automatically open the viewer.
See also: SQL Queries
Execute the following in the terminal to get a count of row in the test database.
echo "SELECT 'SELECT count(*), \"' || name || '\" FROM ' || name || ';' FROM sqlite_master WHERE type = 'table';" | sqlite3 -readonly "test.sqlite3" | sqlite3 -readonly "test.sqlite3"
Execute the following in the terminal to get a count of row in the application database.
echo "SELECT 'SELECT count(*), \"' || name || '\" FROM ' || name || ';' FROM sqlite_master WHERE type = 'table';" | sqlite3 -readonly "development.sqlite3" | sqlite3 -readonly "development.sqlite3"
PRAGMA table_info(<TABLE_NAME>);
example results
0|id|INTEGER|0||1
1|property_name|VARCHAR(4096)|1||0
2|executed_at|INT|1||0