2022-07-06 10:44:36 +03:00
## Description
2022-01-05 19:06:08 +03:00
`sqlite` is a thin wrapper for [the SQLite library ](https://sqlite.org/ ), which in turn is
"a C-language library that implements a small, fast, self-contained,
high-reliability, full-featured, SQL database engine."
2020-12-01 06:00:41 +03:00
# Install SQLite Dependency
2019-12-18 13:22:22 +03:00
2022-01-05 19:06:08 +03:00
Before you can use this module, you must first have the SQLite development
library installed on your system.
2020-12-01 06:00:41 +03:00
**Fedora 31**:
2019-12-18 13:22:22 +03:00
2020-12-01 06:00:41 +03:00
`sudo dnf -y install sqlite-devel`
2019-12-18 13:22:22 +03:00
2019-12-21 10:00:28 +03:00
2020-12-01 06:00:41 +03:00
**Ubuntu 20.04**:
2019-12-21 10:00:28 +03:00
2020-12-01 06:00:41 +03:00
`sudo apt install -y libsqlite3-dev`
2019-12-21 10:00:28 +03:00
2020-12-01 06:00:41 +03:00
**Windows**:
- Download the source zip from [SQLite Downloads ](https://sqlite.org/download.html )
- Create a new `sqlite` subfolder inside `v/thirdparty`
- Extract the zip into that folder
2022-07-06 10:44:36 +03:00
# Performance Tips
2022-07-06 21:01:27 +03:00
When performing a large amount of database calls (i.e. INSERTS), significant performance increase can be obtained by controlling the synchronization and journal modes.
2022-07-06 10:44:36 +03:00
2022-07-06 21:01:27 +03:00
For instance,
```v
db := sqlite.connect('foo.db') or {panic(err)}
db.synchronization_mode(sqlite.SyncMode.off)
db.journal_mode(sqlite.JournalMode.memory)
2022-07-06 10:44:36 +03:00
```