sqlstore

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package sqlstore implements the Auth-All storage boundary over database/sql. One implementation serves every first-party SQL adapter. A Dialect carries the small set of engine-specific behaviors.

Index

Constants

View Source
const SQLiteTimeLayout = "2006-01-02T15:04:05.000000000"

SQLiteTimeLayout is the fixed-width UTC layout used by text timestamp columns. The fixed width keeps lexicographic order equal to time order.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dialect

type Dialect struct {
	// Name is the schema dialect.
	Name schema.Dialect
	// NumberedPlaceholders selects $1 style placeholders instead of ?.
	NumberedPlaceholders bool
	// TextTime stores timestamps as fixed-width UTC text.
	TextTime bool
	// IsUniqueViolation reports whether err is a uniqueness constraint failure.
	IsUniqueViolation func(err error) bool
}

Dialect carries the engine-specific behavior of one adapter.

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store is the database/sql implementation of store.Store.

func New

func New(db *sql.DB, d Dialect) *Store

New returns a store over db.

func (*Store) Accounts

func (s *Store) Accounts() store.AccountStore

Accounts implements store.Store.

func (*Store) Close

func (s *Store) Close() error

Close implements store.Store. The database handle stays open because the application owns it.

func (*Store) DB

func (s *Store) DB() *sql.DB

DB returns the underlying handle. It is owned by the application.

func (*Store) Migrator

func (s *Store) Migrator() store.Migrator

Migrator implements store.Store.

func (*Store) OAuthStates

func (s *Store) OAuthStates() store.OAuthStateStore

OAuthStates implements store.Store.

func (*Store) Sessions

func (s *Store) Sessions() store.SessionStore

Sessions implements store.Store.

func (*Store) Tokens

func (s *Store) Tokens() store.TokenStore

Tokens implements store.Store.

func (*Store) Transaction

func (s *Store) Transaction(ctx context.Context, fn func(store.Store) error) error

Transaction implements store.Store. A nested call joins the running transaction instead of opening a second one.

func (*Store) Users

func (s *Store) Users() store.UserStore

Users implements store.Store.

Jump to

Keyboard shortcuts

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