Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Driver ¶
type Driver interface { // Name of this driver. Name() string // SQL dialect for the database engine; "sqlite", "postgresql", or "mysql". Dialect() string // Connect to the database with the given connect string, which has // everything before the "+" removed. // // If create is true, it should attempt to create the database if it doesn't // exist. // // It may optionally return a driverConn, for example *pgxpool.Pool. This // can be nil. Connect(ctx context.Context, connect string, create bool) (db *sql.DB, driverConn any, err error) // ErrUnique reports if this error reports a UNIQUE constraint violation. ErrUnique(error) bool // Start a new test. This is expected to set up a temporary database which // is cleaned at the end. StartTest(*testing.T, *TestOptions) context.Context }
Driver for a SQL connection.
type NotExistError ¶
type NotExistError struct { Driver string // Driver name DB string // Database name Connect string // Full connect string }
NotExistError is returned by a driver when a database doesn't exist and Create is false in the connection arguments.
func (NotExistError) Error ¶
func (err NotExistError) Error() string
Directories
¶
Path | Synopsis |
---|---|
Package sqlite3 provides a zdb driver for SQLite.
|
Package sqlite3 provides a zdb driver for SQLite. |
Package mariadb provides a zdb driver for MariaDB.
|
Package mariadb provides a zdb driver for MariaDB. |
Package pgx provides a zdb driver for PostgreSQL.
|
Package pgx provides a zdb driver for PostgreSQL. |
Package pq provides a zdb driver for PostgreSQL.
|
Package pq provides a zdb driver for PostgreSQL. |
Click to show internal directories.
Click to hide internal directories.