spanner

package
v0.1.0-alpha.5 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2026 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Name = "spanner"
)

Functions

func DecodeConfig

func DecodeConfig(input any) (database.Connector, error)

DecodeConfig parses a Spanner DSN string. Expected format: projects/<project>/instances/<instance>/databases/<database>

Types

type Config

type Config struct {
	DSN string
}

Config holds connection settings for a Spanner database accessed via the go-sql-spanner driver (GoogleSQL dialect). DSN format: projects/<project>/instances/<instance>/databases/<database>

func (*Config) Connect

func (c *Config) Connect(ctx context.Context) (database.Pool, error)

type Row

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

func (*Row) Scan

func (r *Row) Scan(dest ...any) error

type Rows

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

func (*Rows) Close

func (r *Rows) Close() error

func (*Rows) Collect

func (r *Rows) Collect(dest any) (err error)

func (*Rows) CollectExactlyOneRow

func (r *Rows) CollectExactlyOneRow(dest any) (err error)

func (*Rows) CollectFirst

func (r *Rows) CollectFirst(dest any) (err error)

func (*Rows) Err

func (r *Rows) Err() error

func (*Rows) Next

func (r *Rows) Next() bool

func (*Rows) Scan

func (r *Rows) Scan(dest ...any) error

type SpannerPooler

type SpannerPooler interface {
	// contains filtered or unexported methods
}

type Transaction

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

func (*Transaction) Begin

Begin returns an error: Spanner does not support nested transactions or savepoints.

func (*Transaction) Commit

func (t *Transaction) Commit(_ context.Context) error

func (*Transaction) End

func (t *Transaction) End(ctx context.Context, err error) error

func (*Transaction) Exec

func (t *Transaction) Exec(ctx context.Context, query string, args ...any) (int64, error)

func (*Transaction) Query

func (t *Transaction) Query(ctx context.Context, query string, args ...any) (database.Rows, error)

func (*Transaction) QueryRow

func (t *Transaction) QueryRow(ctx context.Context, query string, args ...any) database.Row

func (*Transaction) Rollback

func (t *Transaction) Rollback(_ context.Context) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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