4,461
edits
iwu Tag: visualeditor |
add other examples |
||
Line 1: | Line 1: | ||
List all tables<syntaxhighlight lang="sqlite3"> | List all databases and related files | ||
<syntaxhighlight lang="sqlite3"> | |||
sqlite> .databases | |||
</syntaxhighlight> | |||
Show schemas of all tables | |||
<syntaxhighlight lang="sqlite3"> | |||
sqlite> .schema | |||
</syntaxhighlight> | |||
Show schemas of a table | |||
<syntaxhighlight lang="sqlite3"> | |||
sqlite> .schema PRODUCTS | |||
</syntaxhighlight> | |||
List all tables | |||
<syntaxhighlight lang="sqlite3"> | |||
sqlite> .tables | sqlite> .tables | ||
</syntaxhighlight> | |||
== Transaction == | |||
Start, commit, or roll back a transaction | |||
<syntaxhighlight lang="sqlite3"> | |||
sqlite> BEGIN | |||
... (perform some operations here) ... | |||
sqlite> COMMIT | |||
sqlite> ROLLBACK | |||
</syntaxhighlight> | |||
== Miscellaneous == | |||
Show execution time of a query | |||
<syntaxhighlight lang="sqlite3"> | |||
sqlite> .timer ON | |||
</syntaxhighlight> | |||
Execute a shell command | |||
<syntaxhighlight lang="sqlite3"> | |||
sqlite> .system ls -l | |||
</syntaxhighlight> | |||
Quit | |||
<syntaxhighlight lang="sqlite3"> | |||
sqlite> .quit | |||
</syntaxhighlight> | </syntaxhighlight> |