Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateDBConnections ¶
CreateDBConnections returns references to logical connections to the underlying SQL databases. By default when UseMultipleDatabases == false, the returned object is to tied to a single SQL database and the object can be used to perform CRUD operations on the tables in the database. If UseMultipleDatabases == true then return connections to all the databases
Types ¶
type Driver ¶
type Driver interface {
// BeginTxx starts a new transaction in the shard of dbShardID
BeginTxx(ctx context.Context, dbShardID int, opts *sql.TxOptions) (*sqlx.Tx, error)
// Commit commits the current transaction(started by BeginTxx)
Commit() error
// Rollback rollbacks the current transaction(started by BeginTxx)
Rollback() error
// Close closes this driver(and underlying connections)
Close() error
// ExecDDL executes a DDL query
ExecDDL(ctx context.Context, dbShardID int, query string, args ...interface{}) (sql.Result, error)
// SelectForSchemaQuery executes a select query for schema(returning multiple rows).
SelectForSchemaQuery(dbShardID int, dest interface{}, query string, args ...interface{}) error
// GetForSchemaQuery executes a get query for schema(returning single row).
GetForSchemaQuery(dbShardID int, dest interface{}, query string, args ...interface{}) error
// contains filtered or unexported methods
}
Driver interface is an abstraction to query SQL. The layer is added so that we can have a adapter to support multiple SQL databases behind a single Cadence cluster
Click to show internal directories.
Click to hide internal directories.