xsql

package
v3.95.4 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: Apache-2.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const (
	QUERY_SERVICE = iota + 1 //nolint:revive,stylecheck
	LEGACY                   //nolint:revive,stylecheck
)

Variables

View Source
var (
	ErrUnsupported = driver.ErrSkip
)

Functions

func WithExplain added in v3.95.0

func WithExplain(ctx context.Context) context.Context

Types

type Conn added in v3.95.0

type Conn struct {
	// contains filtered or unexported fields
}

func (*Conn) Begin added in v3.95.0

func (c *Conn) Begin() (_ driver.Tx, finalErr error)

func (*Conn) BeginTx added in v3.95.0

func (c *Conn) BeginTx(ctx context.Context, opts driver.TxOptions) (_ driver.Tx, finalErr error)

func (*Conn) CheckNamedValue added in v3.95.0

func (c *Conn) CheckNamedValue(value *driver.NamedValue) (finalErr error)

func (*Conn) Close added in v3.95.0

func (c *Conn) Close() (finalErr error)

func (*Conn) Engine added in v3.95.0

func (c *Conn) Engine() Engine

func (*Conn) ExecContext added in v3.95.0

func (c *Conn) ExecContext(ctx context.Context, sql string, args []driver.NamedValue) (
	_ driver.Result, finalErr error,
)

func (*Conn) GetColumnType added in v3.95.0

func (c *Conn) GetColumnType(ctx context.Context, tableName, columnName string) (dataType string, _ error)

func (*Conn) GetColumns added in v3.95.0

func (c *Conn) GetColumns(ctx context.Context, tableName string) (columns []string, _ error)

func (*Conn) GetDatabaseName added in v3.95.0

func (c *Conn) GetDatabaseName() string

func (*Conn) GetIndexColumns added in v3.95.0

func (c *Conn) GetIndexColumns(ctx context.Context, tableName, indexName string) (columns []string, finalErr error)

func (*Conn) GetIndexes added in v3.95.0

func (c *Conn) GetIndexes(ctx context.Context, tableName string) (indexes []string, _ error)

func (*Conn) GetPrimaryKeys added in v3.95.0

func (c *Conn) GetPrimaryKeys(ctx context.Context, tableName string) ([]string, error)

func (*Conn) GetTables added in v3.95.0

func (c *Conn) GetTables(ctx context.Context, folder string, recursive, excludeSysDirs bool) (
	tables []string, _ error,
)

func (*Conn) IsColumnExists added in v3.95.0

func (c *Conn) IsColumnExists(ctx context.Context, tableName, columnName string) (columnExists bool, finalErr error)

func (*Conn) IsPrimaryKey added in v3.95.0

func (c *Conn) IsPrimaryKey(ctx context.Context, tableName, columnName string) (ok bool, _ error)

func (*Conn) IsTableExists added in v3.95.0

func (c *Conn) IsTableExists(ctx context.Context, tableName string) (tableExists bool, finalErr error)

func (*Conn) LastUsage added in v3.95.0

func (c *Conn) LastUsage() time.Time

func (*Conn) Ping added in v3.95.0

func (c *Conn) Ping(ctx context.Context) (finalErr error)

func (*Conn) Prepare added in v3.95.0

func (c *Conn) Prepare(string) (driver.Stmt, error)

func (*Conn) PrepareContext added in v3.95.0

func (c *Conn) PrepareContext(ctx context.Context, sql string) (_ driver.Stmt, finalErr error)

func (*Conn) QueryContext added in v3.95.0

func (c *Conn) QueryContext(ctx context.Context, sql string, args []driver.NamedValue) (
	_ driver.Rows, finalErr error,
)

func (*Conn) Version added in v3.95.0

func (c *Conn) Version(_ context.Context) (_ string, _ error)

type Connector

type Connector struct {
	LegacyOpts []legacy.Option
	Options    []propose.Option
	// contains filtered or unexported fields
}

func Open

func Open(parent ydbDriver, balancer grpc.ClientConnInterface, opts ...Option) (_ *Connector, err error)

func Unwrap

func Unwrap[T *sql.DB | *sql.Conn](v T) (connector *Connector, _ error)

func (*Connector) Bindings added in v3.44.0

func (c *Connector) Bindings() bind.Bindings

func (*Connector) Clock added in v3.95.0

func (c *Connector) Clock() clockwork.Clock

func (*Connector) Close

func (c *Connector) Close() error

func (*Connector) Connect

func (c *Connector) Connect(ctx context.Context) (driver.Conn, error)

func (*Connector) Driver

func (c *Connector) Driver() driver.Driver

func (*Connector) Name added in v3.95.0

func (c *Connector) Name() string

func (*Connector) Open added in v3.95.0

func (c *Connector) Open(name string) (driver.Conn, error)

func (*Connector) Parent added in v3.95.0

func (c *Connector) Parent() ydbDriver

func (*Connector) Query added in v3.95.0

func (c *Connector) Query() *query.Client

func (*Connector) RetryBudget added in v3.95.0

func (c *Connector) RetryBudget() budget.Budget

func (*Connector) Scheme added in v3.95.0

func (c *Connector) Scheme() scheme.Client

func (*Connector) Scripting added in v3.95.0

func (c *Connector) Scripting() scripting.Client

func (*Connector) Table added in v3.95.0

func (c *Connector) Table() table.Client

func (*Connector) Trace added in v3.95.0

func (c *Connector) Trace() *trace.DatabaseSQL

func (*Connector) TraceRetry added in v3.95.0

func (c *Connector) TraceRetry() *trace.Retry

type Engine added in v3.95.0

type Engine uint8

func (Engine) String added in v3.95.0

func (e Engine) String() string

type Option added in v3.95.0

type Option interface {
	Apply(c *Connector) error
}

func Merge added in v3.95.0

func Merge(opts ...Option) Option

func WithDefaultQueryMode

func WithDefaultQueryMode(mode legacy.QueryMode) Option

func WithDisableServerBalancer added in v3.42.4

func WithDisableServerBalancer() Option

func WithFakeTx added in v3.44.0

func WithFakeTx(modes ...legacy.QueryMode) Option

func WithIdleThreshold added in v3.42.5

func WithIdleThreshold(idleThreshold time.Duration) Option

func WithOnClose added in v3.44.0

func WithOnClose(onClose func(*Connector)) Option

func WithQueryOptions added in v3.95.0

func WithQueryOptions(opts ...propose.Option) Option

func WithQueryService added in v3.95.0

func WithQueryService(b bool) Option

func WithRetryBudget added in v3.95.0

func WithRetryBudget(budget budget.Budget) Option

func WithTableOptions added in v3.95.0

func WithTableOptions(opts ...legacy.Option) Option

func WithTrace added in v3.34.0

func WithTrace(
	t *trace.DatabaseSQL,
	opts ...trace.DatabaseSQLComposeOption,
) Option

func WithTraceRetry added in v3.54.0

func WithTraceRetry(
	t *trace.Retry,
	opts ...trace.RetryComposeOption,
) Option

type QueryBindOption added in v3.95.0

type QueryBindOption interface {
	Option
	bind.Bind
}

func WithQueryBind added in v3.44.0

func WithQueryBind(bind bind.Bind) QueryBindOption

func WithTablePathPrefix added in v3.44.0

func WithTablePathPrefix(tablePathPrefix string) QueryBindOption

type Stmt added in v3.95.0

type Stmt struct {
	// contains filtered or unexported fields
}

func (*Stmt) Close added in v3.95.0

func (stmt *Stmt) Close() (finalErr error)

func (*Stmt) Exec added in v3.95.0

func (stmt *Stmt) Exec([]driver.Value) (driver.Result, error)

func (*Stmt) ExecContext added in v3.95.0

func (stmt *Stmt) ExecContext(ctx context.Context, args []driver.NamedValue) (_ driver.Result, finalErr error)

func (*Stmt) NumInput added in v3.95.0

func (stmt *Stmt) NumInput() int

func (*Stmt) Query added in v3.95.0

func (stmt *Stmt) Query([]driver.Value) (driver.Rows, error)

func (*Stmt) QueryContext added in v3.95.0

func (stmt *Stmt) QueryContext(ctx context.Context, args []driver.NamedValue) (_ driver.Rows, finalErr error)

type Tx added in v3.95.0

type Tx struct {
	// contains filtered or unexported fields
}

func (*Tx) Commit added in v3.95.0

func (tx *Tx) Commit() (finalErr error)

func (*Tx) ExecContext added in v3.95.0

func (tx *Tx) ExecContext(ctx context.Context, sql string, args []driver.NamedValue) (
	_ driver.Result, finalErr error,
)

func (*Tx) ID added in v3.95.0

func (tx *Tx) ID() string

func (*Tx) PrepareContext added in v3.95.0

func (tx *Tx) PrepareContext(ctx context.Context, sql string) (_ driver.Stmt, finalErr error)

func (*Tx) QueryContext added in v3.95.0

func (tx *Tx) QueryContext(ctx context.Context, sql string, args []driver.NamedValue) (
	_ driver.Rows, finalErr error,
)

func (*Tx) Rollback added in v3.95.0

func (tx *Tx) Rollback() (finalErr error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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