v/vlib/db/sqlite
2025-05-03 22:37:51 +03:00
..
orm.v all: replace fn name '@xxx' with 'xxx' (#22506) 2024-10-12 22:17:02 +03:00
parent_child_test.v tools: cleanup entries from the hardcoded skip_files list in common.v (used by v test, v test-self etc); use the new // vtest build: syntax to mark the tests instead (#23918) 2025-03-13 19:51:51 +02:00
pool.v db: connection pool (#24161) 2025-04-10 03:17:32 +03:00
README.md db.sqlite: make functions return results, breaking change (#19093) 2023-08-10 05:39:32 +03:00
result_code.v fmt: align the custom values of the enum fields (#19331) 2023-09-12 14:44:38 +03:00
sqlite.c.v checker: do not allow &u8(0), force nil like we do with &Type(0) 2025-05-03 22:37:51 +03:00
sqlite_comptime_field_test.v tools: cleanup entries from the hardcoded skip_files list in common.v (used by v test, v test-self etc); use the new // vtest build: syntax to mark the tests instead (#23918) 2025-03-13 19:51:51 +02:00
sqlite_orm_test.v tools: cleanup entries from the hardcoded skip_files list in common.v (used by v test, v test-self etc); use the new // vtest build: syntax to mark the tests instead (#23918) 2025-03-13 19:51:51 +02:00
sqlite_test.v db: mysql,pg,sqlite add transaction support (fix #24290) (#24352) 2025-04-29 09:10:13 +03:00
sqlite_vfs_lowlevel_test.v tools: cleanup entries from the hardcoded skip_files list in common.v (used by v test, v test-self etc); use the new // vtest build: syntax to mark the tests instead (#23918) 2025-03-13 19:51:51 +02:00
stmt.c.v checker: do not allow &u8(0), force nil like we do with &Type(0) 2025-05-03 22:37:51 +03:00
vfs_lowlevel.c.v fmt: fix alignment of struct init fields (#22025) 2024-08-11 09:11:24 +03:00

Description

sqlite is a thin wrapper for the SQLite library, which in turn is "a C-language library that implements a small, fast, self-contained, high-reliability, full-featured, SQL database engine."

Install SQLite Dependency

Before you can use this module, you must first have the SQLite development library installed on your system.

Fedora 31:

sudo dnf -y install sqlite-devel

Ubuntu 20.04:

sudo apt install -y libsqlite3-dev

Windows:

  • Download the source zip from SQLite Downloads
  • Create a new sqlite subfolder inside v/thirdparty
  • Extract the zip into that folder

Performance Tips

When performing a large amount of database calls (i.e. INSERTS), significant performance increase can be obtained by controlling the synchronization and journal modes.

For instance:

import db.sqlite

db := sqlite.connect('foo.db') or { panic(err) }
db.synchronization_mode(sqlite.SyncMode.off)!
db.journal_mode(sqlite.JournalMode.memory)!