Documentation
¶
Index ¶
- type Ops
- func (o *Ops) Exec(query string, args []driver.Value) (driver.Result, error)
- func (o *Ops) ExecContext(ctx context.Context, query string, args []driver.NamedValue) (driver.Result, error)
- func (o *Ops) Query(query string, args []driver.Value) (driver.Rows, error)
- func (o *Ops) QueryContext(ctx context.Context, query string, args []driver.NamedValue) (driver.Rows, error)
- type Store
- type Tx
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Ops ¶
type Ops struct {
// contains filtered or unexported fields
}
Ops implements SqlOps with a SqlOps service.
func NewOps ¶
func NewOps(client sql_rpc.SRPCSqlOpsClient, released *atomic.Bool) *Ops
NewOps constructs a new SQL ops client.
func (*Ops) ExecContext ¶
func (o *Ops) ExecContext(ctx context.Context, query string, args []driver.NamedValue) (driver.Result, error)
ExecContext executes a query that doesn't return rows.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store implements the SQL store with a RPC client.
func NewStore ¶
func NewStore(client sql_rpc.SRPCSqlClient) *Store
NewStore constructs a new SQL store.
func (*Store) NewSqlTransaction ¶
func (s *Store) NewSqlTransaction(ctx context.Context, write bool, dsn string) (hydra_sql.SqlTransaction, error)
NewSqlTransaction returns a new transaction against the store.
type Tx ¶
type Tx struct {
// Ops implements the SQL operations.
*Ops
// contains filtered or unexported fields
}
Tx is an ongoing transaction with a Store.
func InitTx ¶
func InitTx( ctx context.Context, client sql_rpc.SRPCSql_SqlTransactionClient, opsCaller rpcstream.RpcStreamCaller[sql_rpc.SRPCSql_SqlTransactionRpcClient], write bool, dsn string, ) (*Tx, error)
InitTx negotiates the transaction with the client stream.
func (*Tx) GetReadOnly ¶
GetReadOnly returns if the transaction is read-only.
Click to show internal directories.
Click to hide internal directories.