Documentation
¶
Overview ¶
Package db owns database/sql lifecycle operations without abstracting SQL.
SQLite is available through SQLite. The libsql and go-libsql implementations live in the libsql and golibsql subpackages. Choose one libSQL implementation per executable because both upstream packages register the database/sql driver name "libsql".
Index ¶
Constants ¶
View Source
const ( DialectPostgres = "postgres" DialectSQLite = "sqlite3" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Adapter ¶
type Adapter interface {
Open(context.Context, Config) (*sql.DB, error)
Ping(context.Context, *sql.DB) error
}
Adapter opens a database/sql pool and provides its health check.
type Config ¶
type Config struct {
DSN string
MaxOpenConns int
MaxIdleConns int
ConnMaxLifetime time.Duration
ConnMaxIdleTime time.Duration
}
Config contains the connection string and database/sql pool settings.
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB owns a database/sql connection pool.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package golibsql provides an adapter for github.com/tursodatabase/go-libsql.
|
Package golibsql provides an adapter for github.com/tursodatabase/go-libsql. |
|
Package libsql provides an adapter for github.com/tursodatabase/libsql-client-go.
|
Package libsql provides an adapter for github.com/tursodatabase/libsql-client-go. |
Click to show internal directories.
Click to hide internal directories.