sqlitedb

package module
v0.0.0-...-1469870 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Session

func Session(dsn string, opts ...Option) *session.AdapterSessionConstructor

func SqliteSession

func SqliteSession(dsn string, opts ...Option) *session.AdapterSessionConstructor

SqliteSession creates a session constructor backed by SQLite. Deprecated: use Session instead.

Types

type Option

type Option func(*SQLiteAdapter)

func Context

func Context(ctx context.Context) Option

func SessionName

func SessionName(name string) Option

func WithContext

func WithContext(ctx context.Context) Option

WithContext sets the adapter context. Deprecated: use Context instead.

type SQLiteAdapter

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

func New

func New(db *sql.DB, opts ...Option) *SQLiteAdapter

func NewFromDSN

func NewFromDSN(dsn string, opts ...Option) (*SQLiteAdapter, error)

func (*SQLiteAdapter) AutoMigrate

func (s *SQLiteAdapter) AutoMigrate() error

func (*SQLiteAdapter) Close

func (s *SQLiteAdapter) Close() error

func (*SQLiteAdapter) DB

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

func (*SQLiteAdapter) DeleteConvState

func (s *SQLiteAdapter) DeleteConvState(key string) error

func (*SQLiteAdapter) DeleteStalePeers

func (s *SQLiteAdapter) DeleteStalePeers(olderThan int64) (int64, error)

func (*SQLiteAdapter) GetPeerByID

func (s *SQLiteAdapter) GetPeerByID(id int64) (*storage.Peer, error)

func (*SQLiteAdapter) GetPeerByPhoneNumber

func (s *SQLiteAdapter) GetPeerByPhoneNumber(phone string) (*storage.Peer, error)

func (*SQLiteAdapter) GetPeerByUsername

func (s *SQLiteAdapter) GetPeerByUsername(username string) (*storage.Peer, error)

func (*SQLiteAdapter) GetSession

func (s *SQLiteAdapter) GetSession(version int) (*storage.Session, error)

func (*SQLiteAdapter) ListConvStates

func (s *SQLiteAdapter) ListConvStates() ([]storage.ConvState, error)

func (*SQLiteAdapter) LoadConvState

func (s *SQLiteAdapter) LoadConvState(key string) (*storage.ConvState, error)

func (*SQLiteAdapter) SaveConvState

func (s *SQLiteAdapter) SaveConvState(state *storage.ConvState) error

func (*SQLiteAdapter) SavePeer

func (s *SQLiteAdapter) SavePeer(peer *storage.Peer) error

func (*SQLiteAdapter) UpdateSession

func (s *SQLiteAdapter) UpdateSession(in *storage.Session) error

Jump to

Keyboard shortcuts

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