2023-07-04 19:48:55 +01:00
2023-06-12 10:56:03 +01:00
2023-06-26 13:31:42 +01:00
2023-07-04 02:18:03 +01:00
2023-06-29 20:06:56 +01:00
2023-07-04 11:16:29 +01:00
2023-07-04 02:18:03 +01:00
2023-07-04 11:16:29 +01:00
2023-07-03 17:42:53 +01:00
2023-03-05 12:20:02 +00:00
2023-07-03 17:42:53 +01:00
2023-05-25 17:03:40 +01:00
2023-07-04 02:29:38 +01:00
2023-07-04 02:29:38 +01:00
2023-07-04 02:29:38 +01:00
2023-03-08 17:39:23 +00:00
2023-06-30 12:25:07 +01:00
2023-06-30 12:25:07 +01:00
2023-03-08 17:39:41 +00:00
2023-07-04 02:18:03 +01:00
2023-07-03 17:08:16 +01:00
2023-07-04 11:16:29 +01:00
2023-07-04 19:48:55 +01:00
2023-07-04 19:48:55 +01:00
2023-06-12 10:56:03 +01:00
2023-07-01 15:19:45 +01:00
2023-01-11 14:54:42 +00:00
2023-07-01 00:16:42 +01:00
2023-07-04 02:29:38 +01:00
2023-07-04 11:16:29 +01:00
2023-02-24 15:06:19 +00:00
2023-06-30 11:48:54 +01:00
2023-03-29 15:06:22 +01:00
2023-04-21 13:33:24 +01:00
2023-07-03 17:42:53 +01:00

Go bindings to SQLite using Wazero

Go Reference Go Report Go Coverage

Go module github.com/ncruces/go-sqlite3 wraps a WASM build of SQLite, and uses wazero to provide cgo-free SQLite bindings.

Caveats

This module replaces the SQLite OS Interface (aka VFS) with a pure Go implementation. This has benefits, but also comes with some drawbacks.

Write-Ahead Logging

Because WASM does not support shared memory, WAL support is limited.

To work around this limitation, SQLite is patched to always use EXCLUSIVE locking mode for WAL databases.

Because connection pooling is incompatible with EXCLUSIVE locking mode, to open WAL databases you should disable connection pooling by calling db.SetMaxOpenConns(1).

POSIX Advisory Locks

POSIX advisory locks, which SQLite uses, are broken by design.

On Linux, macOS and illumos, this module uses OFD locks to synchronize access to database files. OFD locks are fully compatible with process-associated POSIX advisory locks.

On BSD Unixes, this module uses BSD locks. BSD locks may not be compatible with process-associated POSIX advisory locks.

Testing

The pure Go VFS is tested by running an unmodified build of SQLite's mptest on Linux, macOS and Windows. Performance is tested by running speedtest1.

Roadmap

  • advanced SQLite features
    • custom functions
    • nested transactions
    • incremental BLOB I/O
    • online backup
    • session extension
  • custom VFSes

Alternatives

Description
No description provided
Readme MIT 49 MiB
Languages
Go 89.9%
C 5.2%
WebAssembly 3.5%
Shell 1.4%