sqlite

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommitTimestamp added in v0.4.0

type CommitTimestamp struct {
	ID        uint `gorm:"primarykey"`
	Timestamp int64
}

CommitTimestamp represents the sqlite table used to track the current commit timestamp

func (CommitTimestamp) TableName added in v0.4.0

func (CommitTimestamp) TableName() string

type MetadataStoreSqlite added in v0.4.0

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

MetadataStoreSqlite stores all data in sqlite. Data may not be persisted

func New

func New(
	dataDir string,
	logger *slog.Logger,
) (*MetadataStoreSqlite, error)

New creates a new in-memory database

func (*MetadataStoreSqlite) AutoMigrate added in v0.4.0

func (d *MetadataStoreSqlite) AutoMigrate(dst ...interface{}) error

AutoMigrate wraps the gorm AutoMigrate

func (*MetadataStoreSqlite) Close added in v0.4.0

func (d *MetadataStoreSqlite) Close() error

Close gets the database handle from our MetadataStore and closes it

func (*MetadataStoreSqlite) Create added in v0.4.0

func (d *MetadataStoreSqlite) Create(value interface{}) *gorm.DB

Create creates a record

func (*MetadataStoreSqlite) DB added in v0.4.0

func (d *MetadataStoreSqlite) DB() *gorm.DB

DB returns the database handle

func (*MetadataStoreSqlite) First added in v0.4.0

func (d *MetadataStoreSqlite) First(args interface{}) *gorm.DB

First returns the first DB entry

func (*MetadataStoreSqlite) GetCommitTimestamp added in v0.4.0

func (d *MetadataStoreSqlite) GetCommitTimestamp() (int64, error)

func (*MetadataStoreSqlite) Order added in v0.4.0

func (d *MetadataStoreSqlite) Order(args interface{}) *gorm.DB

Order orders a DB query

func (*MetadataStoreSqlite) SetCommitTimestamp added in v0.4.0

func (d *MetadataStoreSqlite) SetCommitTimestamp(
	txn *gorm.DB,
	timestamp int64,
) error

func (*MetadataStoreSqlite) Transaction added in v0.4.0

func (d *MetadataStoreSqlite) Transaction() *gorm.DB

Transaction creates a gorm transaction

func (*MetadataStoreSqlite) Where added in v0.4.0

func (d *MetadataStoreSqlite) Where(
	query interface{},
	args ...interface{},
) *gorm.DB

Where constrains a DB query

Jump to

Keyboard shortcuts

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