spanner

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DatabaseAdmin

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

func NewDatabaseAdmin

func NewDatabaseAdmin(ctx context.Context) (*DatabaseAdmin, error)

func (*DatabaseAdmin) Close

func (d *DatabaseAdmin) Close()

func (*DatabaseAdmin) CreateDatabase

func (d *DatabaseAdmin) CreateDatabase(ctx context.Context, projectID, instanceID, databaseID string) error

データベース作成 if not exists

func (*DatabaseAdmin) CreateTable

func (d *DatabaseAdmin) CreateTable(ctx context.Context, projectID, instanceID, databaseID, ddl string) error

テーブル作成

func (*DatabaseAdmin) Databases

func (d *DatabaseAdmin) Databases(ctx context.Context, projectID, instanceID string) ([]string, error)

インスタンス一覧

func (*DatabaseAdmin) DropDatabase

func (d *DatabaseAdmin) DropDatabase(ctx context.Context, projectID, instanceID, databaseID string) error

インスタンス削除 if exists

func (*DatabaseAdmin) DropTable

func (d *DatabaseAdmin) DropTable(ctx context.Context, projectID, instanceID, databaseID, name string) error

テーブル削除 if not exists

type InstanceAdmin

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

func NewInstanceAdmin

func NewInstanceAdmin(ctx context.Context) (*InstanceAdmin, error)

func (*InstanceAdmin) Close

func (i *InstanceAdmin) Close()

func (*InstanceAdmin) Create

func (i *InstanceAdmin) Create(ctx context.Context, projectID, instanceID string) error

インスタンス作成 if not exists

func (*InstanceAdmin) Delete

func (i *InstanceAdmin) Delete(ctx context.Context, projectID, instanceID string) error

インスタンス削除 if exists

func (*InstanceAdmin) Instances

func (i *InstanceAdmin) Instances(ctx context.Context, projectID string) ([]string, error)

インスタンス一覧

type Spanner

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

google-cloud-go

func NewSpanner

func NewSpanner(ctx context.Context, db string) (*Spanner, error)

func (*Spanner) Close

func (s *Spanner) Close()

func (*Spanner) Query

func (s *Spanner) Query(ctx context.Context, sql string) ([]*spannerapi.Row, error)

func (*Spanner) Tables

func (s *Spanner) Tables(ctx context.Context) ([]string, error)

テーブル一覧

func (*Spanner) UpdateMutation

func (s *Spanner) UpdateMutation(ctx context.Context, ms []*spannerapi.Mutation) error

func (*Spanner) UpdateSQL

func (s *Spanner) UpdateSQL(ctx context.Context, sql string) error

type SpannerDB

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

go-sql-spanner

func NewSpannerDB

func NewSpannerDB(dsn string) (*SpannerDB, error)

func (*SpannerDB) Begin

func (s *SpannerDB) Begin(ctx context.Context) (*sql.Tx, error)

func (*SpannerDB) BeginReadOnly

func (s *SpannerDB) BeginReadOnly(ctx context.Context) (*sql.Tx, error)

func (*SpannerDB) Close

func (s *SpannerDB) Close()

func (*SpannerDB) ExecContext

func (s *SpannerDB) ExecContext(ctx context.Context, query string, args ...any) (sql.Result, error)

func (*SpannerDB) Ping

func (s *SpannerDB) Ping(ctx context.Context) error

Jump to

Keyboard shortcuts

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