sqlitecgo

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 9, 2026 License: LGPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Package sqlitecgo adapts the CGO mattn/go-sqlite3 driver to gormdb. It requires CGO_ENABLED=1. Importing it registers the database/sql driver "sqlite3".

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

type Driver struct{}

Driver implements gormdb.SqliteDriver with mattn/go-sqlite3.

func (Driver) Dialector

func (Driver) Dialector(conn gorm.ConnPool) gorm.Dialector

Dialector wraps an open connection pool.

func (Driver) OpenDB

func (Driver) OpenDB(dsn string) (*sql.DB, error)

OpenDB returns a mattn connection pool for dsn. The pragmas PragmaParams put in it run, as "PRAGMA name(value)", on every connection after mattn's own parameters, so they win over mattn's defaults (synchronous=NORMAL).

func (Driver) PragmaParams

func (Driver) PragmaParams(pragmas map[string]string) url.Values

PragmaParams returns the pragmas as name(value) values of a parameter of gormdb's own, sorted by name; OpenDB runs them (see pragmaParam).

func (Driver) ReaderParams

func (Driver) ReaderParams(busyTimeout time.Duration) url.Values

ReaderParams returns a reader's DSN query parameters in mattn's format.

func (Driver) WriterParams

func (d Driver) WriterParams(busyTimeout time.Duration) url.Values

WriterParams returns the writer's DSN query parameters in mattn's format.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL