Documentation ¶
Index ¶
- Constants
- type DebugDriver
- func (d *DebugDriver) BeginTx(ctx context.Context, opts *sql.TxOptions) (Tx, error)
- func (d *DebugDriver) Exec(ctx context.Context, query string, args, v interface{}) error
- func (d *DebugDriver) Query(ctx context.Context, query string, args, v interface{}) error
- func (d *DebugDriver) Tx(ctx context.Context) (Tx, error)
- type DebugTx
- type Driver
- type ExecQuerier
- type Tx
Constants ¶
View Source
const ( MySQL = "mysql" SQLite = "sqlite3" Postgres = "postgres" Gremlin = "gremlin" )
Dialect names for external usage.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DebugDriver ¶
type DebugDriver struct { Driver // underlying driver. // contains filtered or unexported fields }
DebugDriver is a driver that logs all driver operations.
func (*DebugDriver) BeginTx ¶
BeginTx adds an log-id for the transaction and calls the underlying driver BeginTx command if it's supported.
func (*DebugDriver) Exec ¶
func (d *DebugDriver) Exec(ctx context.Context, query string, args, v interface{}) error
Exec logs its params and calls the underlying driver Exec method.
type DebugTx ¶
type DebugTx struct { Tx // underlying transaction. // contains filtered or unexported fields }
DebugTx is a transaction implementation that logs all transaction operations.
type Driver ¶
type Driver interface { ExecQuerier // Tx starts and returns a new transaction. // The provided context is used until the transaction is committed or rolled back. Tx(context.Context) (Tx, error) // Close closes the underlying connection. Close() error // Dialect returns the dialect name of the driver. Dialect() string }
Driver is the interface that wraps all necessary operations for ent clients.
type ExecQuerier ¶
type ExecQuerier interface { // Exec executes a query that doesn't return rows. For example, in SQL, INSERT or UPDATE. // It scans the result into the pointer v. In SQL, you it's usually sql.Result. Exec(ctx context.Context, query string, args, v interface{}) error // Query executes a query that returns rows, typically a SELECT in SQL. // It scans the result into the pointer v. In SQL, you it's usually *sql.Rows. Query(ctx context.Context, query string, args, v interface{}) error }
ExecQuerier wraps the 2 database operations.
Directories ¶
Path | Synopsis |
---|---|
graph/dsl
Package dsl provide an API for writing gremlin dsl queries almost as-is in Go without using strings in the code.
|
Package dsl provide an API for writing gremlin dsl queries almost as-is in Go without using strings in the code. |
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. |
Click to show internal directories.
Click to hide internal directories.