File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5764,21 +5764,20 @@ db.schema('users')! // CREATE statement(s)
57645764db.db_size()! // file size in bytes
57655765```
57665766
5767- ### Using the self contained SQLite module
5767+ ### Using the ` sqlite ` VPM package
5768+ V also maintains the [ ` sqlite ` ] ( https://vpm.vlang.io/packages/sqlite ) VPM package.
5769+ It wraps an SQLite amalgamation, but otherwise has the same API as ` db.sqlite ` .
57685770
5769- V also maintains a separate ` sqlite ` module, that wraps an SQLite
5770- amalgamation, but otherwise has the same API as the ` db.sqlite `
5771- module. Its benefit is that you do not need to install a separate
5772- system-level sqlite package (which can be hard on some systems
5773- like Windows, or systems with musl for example). Its downside is
5774- that it can make compilations a bit slower since it compiles
5775- SQLite from C in addition to your own code.
5771+ Its benefit is that you do not need to install a separate system-level SQLite package or
5772+ library on your system, which can be harder on Windows or musl-based systems.
5773+ Its downside is that it can make compilation a bit slower, since it compiles SQLite from C
5774+ in addition to your own code.
57765775
5777- To use it, do :
5776+ To install it, run :
57785777``` sh
57795778v install sqlite
57805779```
5781- and later , in your code, use this:
5780+ Then , in your code, use this:
57825781``` v ignore
57835782import sqlite
57845783```
Original file line number Diff line number Diff line change @@ -89,6 +89,14 @@ sql db {
8989}!
9090```
9191
92+ > [ !TIP]
93+ > This guide uses the built-in ` db.sqlite ` module. If you want SQLite without first installing
94+ > system-level SQLite development files, the V team also maintains the
95+ > [ ` sqlite ` ] ( https://vpm.vlang.io/packages/sqlite ) VPM package.
96+ >
97+ > Install it with ` v install sqlite ` and change ` import db.sqlite ` to ` import sqlite ` .
98+ > The package keeps the same API while bundling SQLite for you.
99+
92100When you need to reference the table, simply pass the struct itself.
93101
94102``` v ignore
You can’t perform that action at this time.
0 commit comments