@@ -5639,13 +5639,40 @@ instead:
56395639- Fedora/RHEL: ` sudo dnf -y install sqlite-devel `
56405640- Arch: ` sudo pacman -S sqlite `
56415641
5642+ ### Interactive SQLite CLI
5643+
5644+ V includes a built-in SQLite CLI (` v sqlite ` ) as a V-native
5645+ replacement for ` sqlite3 ` :
5646+
5647+ ``` sh
5648+ v sqlite mydb.db
5649+ ```
5650+
5651+ It provides a full readline REPL with history and tab completion,
5652+ 9 output modes, ` .dump ` , ` .import ` /` .export ` , ` .backup ` , session
5653+ control, and schema tools. Run ` .help ` inside the REPL for the
5654+ full command list.
5655+
5656+ ### Convenience Methods
5657+
5658+ The ` db.sqlite ` module includes helper methods for common queries:
5659+
5660+ ``` v ignore
5661+ db.tables()! // list all user table names
5662+ db.columns('users')! // column names for a table
5663+ db.schema('users')! // CREATE statement(s)
5664+ db.db_size()! // file size in bytes
5665+ ```
5666+
56425667### Using the self contained SQLite module
5643- V also maintains a separate ` sqlite ` module, that wraps an SQLite amalgamation, but otherwise
5644- has the same API as the ` db.sqlite ` module. Its benefit, is that with it, you do not need to
5645- install a separate system level sqlite package/library on your system (which can be hard on
5646- some systems like windows, or systems with musl for example).
5647- Its negative is that it can make your compilations a bit slower (since it compiles SQLite
5648- from C, in addition to your own code).
5668+
5669+ V also maintains a separate ` sqlite ` module, that wraps an SQLite
5670+ amalgamation, but otherwise has the same API as the ` db.sqlite `
5671+ module. Its benefit is that you do not need to install a separate
5672+ system-level sqlite package (which can be hard on some systems
5673+ like Windows, or systems with musl for example). Its downside is
5674+ that it can make compilations a bit slower since it compiles
5675+ SQLite from C in addition to your own code.
56495676
56505677To use it, do:
56515678``` sh
0 commit comments