libsqlgoose

package module
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2025 License: MIT Imports: 11 Imported by: 0

README

LibSQL Goose Store Go Reference Go Workflow

Store is an alternate Goose Store implementation that parses INTEGER timestamp value using time.Unix instead of passing a time.Time to Scan. I am not sure why it was failing in my app (both mine and the Turso Driver) now seem to work, but I decided to publish my hack here.

Documentation

Index

Constants

View Source
const Dialect = goose.DialectCustom

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	// Logger may be used for by each exported method.
	// Logs are level slog.LevelDebug.
	// When it is not set, logging is skipped.
	Logger *slog.Logger
	// contains filtered or unexported fields
}

Store is an alternate Goose Store implementation that scans tstamp as an INTEGER time.Unix value instead of a time.Time.

func NewStore

func NewStore() *Store

func NewStoreWithName

func NewStoreWithName(tableName string) *Store

func (*Store) CreateVersionTable

func (store *Store) CreateVersionTable(ctx context.Context, db database.DBTxConn) error

CreateVersionTable differs from GOOS in that it uses an INTEGER for tstamp.

func (*Store) Delete

func (store *Store) Delete(ctx context.Context, db database.DBTxConn, version int64) error

func (*Store) GetLatestVersion

func (store *Store) GetLatestVersion(ctx context.Context, db database.DBTxConn) (int64, error)

func (*Store) GetMigration

func (store *Store) GetMigration(ctx context.Context, db database.DBTxConn, version int64) (*database.GetMigrationResult, error)

GetMigration differs from GOOS in that it scans an int64 (instead of time.Time) for tstamp and converts it into a time.Time.

func (*Store) Insert

func (store *Store) Insert(ctx context.Context, db database.DBTxConn, req database.InsertRequest) error

func (*Store) ListMigrations

func (store *Store) ListMigrations(ctx context.Context, db database.DBTxConn) ([]*database.ListMigrationsResult, error)

func (*Store) TableExists

func (store *Store) TableExists(ctx context.Context, db database.DBTxConn) (bool, error)

func (*Store) Tablename

func (store *Store) Tablename() string

Jump to

Keyboard shortcuts

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