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:

  1. the default configuration is established as follows:
mode            = LIST
separator       = "|"
main prompt     = "sqlite> "
continue prompt = "   ...> "
  1. if the file ${XDG_CONFIG_HOME}/sqlcipher/sqliterc or ~/.sqliterc exists, the first of those to be found is processed during startup. it should generally only contain meta-commands πŸŽ€
  2. if the -init option is present, the specified file is processed.
  3. all other command line options are processed.

✨ SEE ALSO ✨


✨ 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