Skip to content

sqlite3

import "github.com/go-rel/sqlite3"

Overview

Package sqlite3 wraps go-sqlite3 driver as an adapter for rel.

Usage:

// open sqlite3 connection.
adapter, err := sqlite3.Open("dev.db")
if err != nil {
    panic(err)
}
defer adapter.Close()

// initialize rel's repo.
repo := rel.New(adapter)

Constants

const Name string = "sqlite3"
Name of database type this adapter implements.

func MustOpen

func MustOpen(dsn string) rel.Adapter
MustOpen sqlite3 connection using dsn.

func New

func New(database *db.DB) rel.Adapter
New sqlite3 adapter using existing connection.

func Open

func Open(dsn string) (rel.Adapter, error)
Open sqlite3 connection using dsn.

type SQLite3

type SQLite3 struct {
    sql.SQL
}
SQLite3 adapter

func (SQLite3) Name

func (SQLite3) Name() string
Name of database adapter.


Last update: 2024-08-16