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
- type Dialect
- type Store
- func (s *Store) Accounts() store.AccountStore
- func (s *Store) Close() error
- func (s *Store) DB() *sql.DB
- func (s *Store) Migrator() store.Migrator
- func (s *Store) OAuthStates() store.OAuthStateStore
- func (s *Store) Sessions() store.SessionStore
- func (s *Store) Tokens() store.TokenStore
- func (s *Store) Transaction(ctx context.Context, fn func(store.Store) error) error
- func (s *Store) Users() store.UserStore
Constants ¶
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 (*Store) Accounts ¶
func (s *Store) Accounts() store.AccountStore
Accounts implements store.Store.
func (*Store) Close ¶
Close implements store.Store. The database handle stays open because the application owns it.
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) Transaction ¶
Transaction implements store.Store. A nested call joins the running transaction instead of opening a second one.