Skip to content

Commit 6d9a580

Browse files
committed
docs: suggest the vpm sqlite module in v documentation for orm (fixes #25768)
1 parent df8cb3e commit 6d9a580

2 files changed

Lines changed: 17 additions & 10 deletions

File tree

doc/docs.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5764,21 +5764,20 @@ db.schema('users')! // CREATE statement(s)
57645764
db.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
57795778
v install sqlite
57805779
```
5781-
and later, in your code, use this:
5780+
Then, in your code, use this:
57825781
```v ignore
57835782
import sqlite
57845783
```

vlib/orm/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff 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+
92100
When you need to reference the table, simply pass the struct itself.
93101

94102
```v ignore

0 commit comments

Comments
 (0)