Documentation
¶
Overview ¶
Package sqlite provides a durable, embedded queue.Service backed by SQLite.
Use it with any database/sql SQLite driver (modernc.org/sqlite, mattn/go-sqlite3).
SQLite has no FOR UPDATE SKIP LOCKED. Claim queries run inside a BEGIN IMMEDIATE transaction; concurrent claimers serialize on the database write lock. This is fine for embedded single-process workloads. For high throughput across many processes, use the pgx backend instead.
The database is opened in WAL mode (PRAGMA journal_mode=WAL; PRAGMA synchronous=NORMAL) for adequate write throughput. The caller is responsible for opening the *sql.DB; queue/sqlite does not own connection lifetime.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Schema string
Functions ¶
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is the SQLite queue implementation.
func New ¶
func New(db *sql.DB, opts ...queue.QueueOption) *Service
New constructs a SQLite queue.Service. The caller owns db.