SQLCIPHER(1)
π
SQLCIPHER(1) β the sqlcipher manual, but make it make sense
okay bestie, welcome to the sqlcipher page from the General Commands Manual β yes that's the real manual name, i'm not making it up π this is the whole thing, rewritten so you actually get it, with every single detail intact. no cap.
β¨ NAME β¨
sqlcipher β a command line interface for SQLCipher version 3 π
β¨ SYNOPSIS β¨
sqlcipher [options] [databasefile] [SQL]
that's it. that's the whole vibe check. π
β¨ SUMMARY β¨
so like, sqlcipher is this terminal-based front-end to the SQLCipher library that can run queries interactively and show you the results in multiple formats. super versatile, main character energy fr. it also works inside shell scripts and other applications when you need that batch processing feature π
β¨ DESCRIPTION β¨
to start an interactive sqlcipher session, you just invoke the sqlcipher command and optionally hand it the name of a database file. here's the lowkey iconic part:
- if the database file doesn't exist β it gets created π±
- if the database file does exist β it gets opened π
for example, to create a new database file named mydata.db, create a table named memos, and insert a couple of records into that table:
$ sqlcipher mydata.db
SQLCipher version 3.43.0 2023-08-11 17:45:23
Enter ".help" for usage hints.
sqlite> create table memos(text, priority INTEGER);
sqlite> insert into memos values('deliver project description', 10);
sqlite> insert into memos values('lunch with Christine', 100);
sqlite> select * from memos;
deliver project description|10
lunch with Christine|100
sqlite>
look at her go π₯Ή she ate.
if no database name is supplied, you can use the ATTACH sql command to attach to existing database files or create new ones. ATTACH is also how you attach to multiple databases within the same interactive session β which is genuinely so useful for migrating data between databases, possibly changing the schema along the way. like moving houses but for tables πβ¨
optionally, a SQL statement or set of SQL statements can be supplied as a single argument. multiple statements should be separated by semicolons (;). periodt.
for example:
$ sqlcipher -line mydata.db 'select * from memos where priority > 20;'
text = lunch with Christine
priority = 100
π¦ SQLITE META-COMMANDS π¦
the interactive interpreter offers a set of meta-commands that you can use to:
- control the output format π¨
- examine the currently attached database files π
- perform administrative operations upon the attached databases (such as rebuilding indices) π οΈ
meta-commands are always prefixed with a dot (.). iykyk.
a list of available meta-commands can be viewed at any time by issuing the .help command. for example:
sqlite> .help
β οΈ heads up bestie: the available commands differ by version and build options, so they are not listed here. please refer to your local copy for all available options. fr fr, don't @ me. π
β¨ INIT FILE β¨
sqlcipher reads an initialization file to set the configuration of the interactive environment. throughout initialization, any previously specified setting can be overridden β it's very "last one wins" of her π
the sequence of initialization is as follows:
- the default configuration is established as follows:
mode = LIST
separator = "|"
main prompt = "sqlite> "
continue prompt = " ...> "
- if the file
${XDG_CONFIG_HOME}/sqlcipher/sqlitercor~/.sqlitercexists, the first of those to be found is processed during startup. it should generally only contain meta-commands π - if the
-initoption is present, the specified file is processed. - all other command line options are processed.
β¨ SEE ALSO β¨
- https://zetetic.net/sqlcipher
- the
sqlcipher-docpackage.
β¨ AUTHOR β¨
this manual page was originally written by Andreas Rottmann <rotty@debian.org>, for the Debian GNU/Linux system (but may be used by others). it was subsequently revised by Bill Bumgarner <bbum@mac.com>, Laszlo Boszormenyi <gcs@debian.hu>, and the sqlcipher developers. absolute legends, all of them π«Άπ
and that's the whole page, bestie!! no crumbs left behind π
this iconic little writeup is the SQLCIPHER(1) page from General Commands Manual, dated Fri Aug 11 23:50:12 CET 2023 β screenshot it, cite it, frame it, whatever. mwah πβ¨
π¦ where this page comes from
- alpine 3.24: sqlcipher-doc 4.6.1-r1 Β· BSD-3-Clause
- arch rolling: sqlcipher 4.18.0-1 Β· BSD-3-Clause
- debian trixie: sqlcipher 4.6.1-2 Β· LicenseRef-public-domain
- ubuntu questing: sqlcipher 4.6.1-2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms