hammer

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Scheme

func Scheme(uri string) string

Types

type AlterColumn

type AlterColumn struct {
	Table      spansql.ID
	Def        spansql.ColumnDef
	SetOptions bool
}

func (AlterColumn) SQL

func (a AlterColumn) SQL() string

type ChangeStream added in v0.6.0

type ChangeStream struct {
	*spansql.CreateChangeStream
}

func (*ChangeStream) WatchNone added in v0.6.0

func (cs *ChangeStream) WatchNone() bool

func (*ChangeStream) WatchTable added in v0.6.0

func (cs *ChangeStream) WatchTable() bool

type Client

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

func NewClient

func NewClient(ctx context.Context, uri string) (*Client, error)

func (*Client) ApplyDatabaseDDL

func (c *Client) ApplyDatabaseDDL(ctx context.Context, ddl DDL) error

func (*Client) CreateDatabase

func (c *Client) CreateDatabase(ctx context.Context, ddl DDL) error

func (*Client) GetDatabaseDDL

func (c *Client) GetDatabaseDDL(ctx context.Context) (string, error)

type DDL

type DDL struct {
	List []Statement
}

func Diff

func Diff(ddl1, ddl2 DDL) (DDL, error)

func ParseDDL

func ParseDDL(uri, schema string, option *DDLOption) (DDL, error)

func (*DDL) Append

func (d *DDL) Append(stmts ...Statement)

func (*DDL) AppendDDL

func (d *DDL) AppendDDL(ddl DDL)

type DDLOption added in v0.5.8

type DDLOption struct {
	IgnoreAlterDatabase bool
	IgnoreChangeStreams bool
}

type Database

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

func NewDatabase

func NewDatabase(ddl DDL) (*Database, error)

type FileSource

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

func NewFileSource

func NewFileSource(uri string) (*FileSource, error)

func (*FileSource) DDL

func (s *FileSource) DDL(_ context.Context, option *DDLOption) (DDL, error)

func (*FileSource) String

func (s *FileSource) String() string

type Generator

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

func (*Generator) GenerateDDL

func (g *Generator) GenerateDDL() DDL

type Source

type Source interface {
	String() string
	DDL(context.Context, *DDLOption) (DDL, error)
}

func NewSource

func NewSource(ctx context.Context, uri string) (Source, error)

type SpannerSource

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

func NewSpannerSource

func NewSpannerSource(ctx context.Context, uri string) (*SpannerSource, error)

func (*SpannerSource) Apply

func (s *SpannerSource) Apply(ctx context.Context, ddl DDL) error

func (*SpannerSource) Create

func (s *SpannerSource) Create(ctx context.Context, ddl DDL) error

func (*SpannerSource) DDL

func (s *SpannerSource) DDL(ctx context.Context, option *DDLOption) (DDL, error)

func (*SpannerSource) String

func (s *SpannerSource) String() string

type Statement

type Statement interface {
	SQL() string
}

type Table

type Table struct {
	*spansql.CreateTable
	// contains filtered or unexported fields
}

type Update

type Update struct {
	Table spansql.ID
	Def   spansql.ColumnDef
}

func (Update) SQL

func (u Update) SQL() string

type View added in v0.6.2

type View struct {
	*spansql.CreateView
}

Jump to

Keyboard shortcuts

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