v/vlib/db/sqlite
2025-08-05 08:54:48 +03:00
..
orm.v breaking,orm: add table attrs; add table/field comment support for mysql and pg (#24744) 2025-06-18 10:20:09 +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 db.sqlite: fix get_text trimming data after (including) first 0 character (#25040) 2025-08-05 08:54:48 +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 breaking,orm: add table attrs; add table/field comment support for mysql and pg (#24744) 2025-06-18 10:20:09 +03:00
sqlite_test.v db: modify mysql/pg/sqlite interface for pool working (#24780) 2025-06-27 02:25: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 db.sqlite: fix get_text trimming data after (including) first 0 character (#25040) 2025-08-05 08:54:48 +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)!