sql

package
v0.4.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	Postgres common.SQLDriverType = "postgres"
	SQLite   common.SQLDriverType = "sqlite"

	SQLPersistence driver2.PersistenceType = "sql"
)

Variables

View Source
var UnversionedConstructors = map[common.SQLDriverType]persistenceConstructor[unversionedPersistence]{
	Postgres: func(o common.Opts, t string) (unversionedPersistence, error) { return postgres.NewUnversioned(o, t) },
	SQLite:   func(o common.Opts, t string) (unversionedPersistence, error) { return sqlite.NewUnversioned(o, t) },
}
View Source
var VersionedConstructors = map[common.SQLDriverType]persistenceConstructor[transactionalVersionedPersistence]{
	Postgres: func(o common.Opts, t string) (transactionalVersionedPersistence, error) {
		return postgres.NewVersioned(o, t)
	},
	SQLite: func(o common.Opts, t string) (transactionalVersionedPersistence, error) {
		return sqlite.NewVersioned(o, t)
	},
}

Functions

func NewDriver

func NewDriver() driver.NamedDriver

func NewPersistenceWithOpts

func NewPersistenceWithOpts[V dbObject](dataSourceName string, opts common.Opts, constructors map[common.SQLDriverType]persistenceConstructor[V]) (V, error)

Types

type Driver

type Driver struct {
}

func (*Driver) NewTransactionalUnversioned

func (d *Driver) NewTransactionalUnversioned(dataSourceName string, config driver.Config) (driver.TransactionalUnversionedPersistence, error)

func (*Driver) NewTransactionalVersioned

func (d *Driver) NewTransactionalVersioned(dataSourceName string, config driver.Config) (driver.TransactionalVersionedPersistence, error)

func (*Driver) NewUnversioned

func (d *Driver) NewUnversioned(dataSourceName string, config driver.Config) (driver.UnversionedPersistence, error)

func (*Driver) NewVersioned

func (d *Driver) NewVersioned(dataSourceName string, config driver.Config) (driver.VersionedPersistence, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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