v/vlib/db/sqlite
2025-03-13 19:51:51 +02: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
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: add tracing for more calls, when using -d trace_sqlite, not just for the ORM 2025-01-07 16:43:10 +02: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 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_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 pg: hande C calls, move to .c.v files (#19739) 2023-11-03 20:43:44 +02: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)!