storage

package
v1.12.13 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EntSqliteClientConfig

type EntSqliteClientConfig struct {
	// Path to the sqlite database file
	Path string

	// Read Only mode
	ReadOnly bool

	// Skip schema creation
	SkipSchemaCreation bool

	// Fail if path already exists
	FailIfPathExists bool

	// Overwrite if path already exists
	OverwriteIfPathExists bool
}

type Storage

type Storage[T any] interface {
	// Returns a client to the underlying storage driver.
	// We will NOT hide the underlying storage driver because for an ORM
	// which already abstracts DB connection, its unnecessary work to abstract
	// an ORM and then implement function wrappers for all ORM operations.
	Client() (T, error)

	// Close any open connections, file descriptors and free
	// any resources used by the storage driver
	Close() error
}

Storage interface defines a generic contract for implementing a storage driver in the system. This usually means wrapping a DB client with our defined interface.

func NewEntSqliteStorage

func NewEntSqliteStorage(config EntSqliteClientConfig) (Storage[*ent.Client], error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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