sql_rpc_client

package
v0.52.0-rc2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 21, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

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) Exec

func (o *Ops) Exec(query string, args []driver.Value) (driver.Result, error)

Exec executes a query that doesn't return rows.

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.

func (*Ops) Query

func (o *Ops) Query(query string, args []driver.Value) (driver.Rows, error)

Query executes a query that may return rows.

func (*Ops) QueryContext

func (o *Ops) QueryContext(ctx context.Context, query string, args []driver.NamedValue) (driver.Rows, error)

QueryContext executes a query that may 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

InitTx negotiates the transaction with the client stream.

func (*Tx) Commit

func (t *Tx) Commit(ctx context.Context) error

Commit commits the transaction to storage.

func (*Tx) Discard

func (t *Tx) Discard()

Discard cancels the transaction.

func (*Tx) GetReadOnly

func (t *Tx) GetReadOnly() bool

GetReadOnly returns if the transaction is read-only.

func (*Tx) GetSqlOps

func (t *Tx) GetSqlOps(ctx context.Context) (hydra_sql.SqlOps, error)

GetSqlOps returns the sql operations interface.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL