Documentation
¶
Index ¶
Constants ¶
View Source
const ( MySQL = "mysql" SQLite = "sqlite3" Postgres = "postgres" Oracle = "oracle" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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.
Click to show internal directories.
Click to hide internal directories.