1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
v/vlib/sqlite
2022-09-15 07:59:31 +03:00
..
orm.v orm: support parenthesized expressions as in select from User where (name == 'Sam' && is_customer == true) || id == 1 (#15693) 2022-09-09 21:08:48 +03:00
README.md ci: fix failing v check-md vlib/sqlite/README.md 2022-07-07 13:05:05 +03:00
result_code.v sqlite: add enum result code (#12505) 2021-11-18 13:56:15 +02:00
sqlite_orm_test.v orm: default attribute (#15221) 2022-07-27 00:59:32 +03:00
sqlite_test.v orm: default attribute (#15221) 2022-07-27 00:59:32 +03:00
sqlite.v checker: fix nested struct reference type field initialized check. (fix: #15741) (#15752) 2022-09-15 07:59:31 +03:00
stmt.v orm: init or implementation (#14989) 2022-08-31 14:43:20 +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 sqlite

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