Documentation
¶
Index ¶
- Constants
- Variables
- type Capabilities
- type ConstraintError
- type ConstraintKind
- type DebugDriver
- func (d *DebugDriver) BeginTx(ctx context.Context, opts *TxOptions) (Tx, error)
- func (d *DebugDriver) DB() *sql.DB
- func (d *DebugDriver) Exec(ctx context.Context, query string, args []any) (Result, error)
- func (d *DebugDriver) Query(ctx context.Context, query string, args []any) (Rows, error)
- func (d *DebugDriver) Tx(ctx context.Context) (Tx, error)
- type DebugTx
- type Dialect
- type Driver
- type ExecQuerier
- type Result
- type Rows
- type Tx
- type TxOptions
- type UnsupportedError
Constants ¶
View Source
const ( Postgres = "postgres" SQLite = "sqlite3" )
Variables ¶
View Source
var ErrNoRows = sql.ErrNoRows
ErrNoRows is returned when a statement that must produce a row produces none. It is the database/sql sentinel so that errors.Is(err, sql.ErrNoRows) keeps working.
Functions ¶
This section is empty.
Types ¶
type Capabilities ¶ added in v0.3.0
type ConstraintError ¶ added in v0.3.0
type ConstraintError struct {
Kind ConstraintKind
Constraint string
Table string
Err error
}
ConstraintError is returned by drivers when a statement violates a constraint.
func (*ConstraintError) Error ¶ added in v0.3.0
func (e *ConstraintError) Error() string
func (*ConstraintError) Unwrap ¶ added in v0.3.0
func (e *ConstraintError) Unwrap() error
type ConstraintKind ¶ added in v0.3.0
type ConstraintKind uint8
ConstraintKind classifies a violated database constraint.
const ( Unique ConstraintKind = iota ForeignKey Check NotNull Exclusion )
Constraint kinds reported by drivers.
type DebugDriver ¶
type DebugDriver struct {
Driver
// contains filtered or unexported fields
}
func (*DebugDriver) DB ¶ added in v0.3.0
func (d *DebugDriver) DB() *sql.DB
DB exposes the migration connection when supported by the wrapped driver.
type DebugTx ¶
type DebugTx struct {
Tx
// contains filtered or unexported fields
}
type Driver ¶
type ExecQuerier ¶
type Tx ¶
type Tx interface {
ExecQuerier
Commit() error
Rollback() error
}
type UnsupportedError ¶ added in v0.3.0
UnsupportedError is returned when a feature is used on a dialect that lacks it.
func (*UnsupportedError) Error ¶ added in v0.3.0
func (e *UnsupportedError) Error() string
Directories
¶
| Path | Synopsis |
|---|---|
|
Package pg implements the driver boundary with native pgx codecs.
|
Package pg implements the driver boundary with native pgx codecs. |
|
Package sql provides wrappers around the standard database/sql package to allow the generated code to interact with a statically-typed API.
|
Package sql provides wrappers around the standard database/sql package to allow the generated code to interact with a statically-typed API. |
|
schema
Package schema contains all schema migration logic for SQL dialects.
|
Package schema contains all schema migration logic for SQL dialects. |
|
sqlgraph
Package sqlgraph provides graph abstraction capabilities on top of sql-based databases for ent codegen.
|
Package sqlgraph provides graph abstraction capabilities on top of sql-based databases for ent codegen. |
|
Package sqlite uses ncruces SQLite through database/sql.
|
Package sqlite uses ncruces SQLite through database/sql. |
Click to show internal directories.
Click to hide internal directories.