sql

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildDDLOpts

type BuildDDLOpts struct {
	UseIfNotExists bool
	UseIfExists    bool

	Source config.DatabaseDriver
}

type CreateSequenceParams

type CreateSequenceParams struct {
	UseIfNotExists bool

	Source config.DatabaseDriver
}

type DDL

type DDL struct {
	Name        gds.String
	UpQueries   []string
	DownQueries []string
}

type DDLBuilder

type DDLBuilder interface {
	Build(schema *schema.Schema, opts BuildDDLOpts) (*DDL, error)
	BuildPerTable(schema *schema.Schema, opts BuildDDLOpts) ([]*DDL, error)
}

type DDLBuilderManager

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

func NewDDLBuilderManager

func NewDDLBuilderManager() *DDLBuilderManager

func (*DDLBuilderManager) For

type MySQLDDLBuilder

type MySQLDDLBuilder struct {
}

func NewMySQLDDLBuilder

func NewMySQLDDLBuilder() *MySQLDDLBuilder

func (*MySQLDDLBuilder) Build

func (b *MySQLDDLBuilder) Build(schema *schema.Schema, params BuildDDLOpts) (*DDL, error)

func (*MySQLDDLBuilder) BuildPerTable

func (b *MySQLDDLBuilder) BuildPerTable(sch *schema.Schema, params BuildDDLOpts) ([]*DDL, error)

func (*MySQLDDLBuilder) CreateUniqueKey

func (b *MySQLDDLBuilder) CreateUniqueKey(name string, columns *gds.Strings) string

type PostgresDDLBuilder

type PostgresDDLBuilder struct {
}

func NewPostgresDDLBuilder

func NewPostgresDDLBuilder() *PostgresDDLBuilder

func (*PostgresDDLBuilder) Build

func (b *PostgresDDLBuilder) Build(schema *schema.Schema, params BuildDDLOpts) (*DDL, error)

func (*PostgresDDLBuilder) BuildPerTable

func (b *PostgresDDLBuilder) BuildPerTable(sch *schema.Schema, opts BuildDDLOpts) ([]*DDL, error)

func (*PostgresDDLBuilder) CommentOnColumn

func (b *PostgresDDLBuilder) CommentOnColumn(col *schema.Column) string

func (*PostgresDDLBuilder) CreateEnum

func (b *PostgresDDLBuilder) CreateEnum(enum *schema.Enum) string

func (*PostgresDDLBuilder) CreatePrimaryKey

func (b *PostgresDDLBuilder) CreatePrimaryKey(name string, columns *gds.Strings) string

func (*PostgresDDLBuilder) CreateSequence

func (b *PostgresDDLBuilder) CreateSequence(seq *schema.Sequence, params CreateSequenceParams) (string, error)

func (*PostgresDDLBuilder) CreateUniqueKey

func (b *PostgresDDLBuilder) CreateUniqueKey(name string, columns *gds.Strings) string

type QueryBuilder

type QueryBuilder struct {
}

func NewInsertBuilder

func NewInsertBuilder() *QueryBuilder

func (*QueryBuilder) BuildDeleteInQuery

func (b *QueryBuilder) BuildDeleteInQuery(table string, field string, values []interface{}) string

func (*QueryBuilder) BuildDeleteQueries

func (b *QueryBuilder) BuildDeleteQueries(table *schema.Table, rows []map[string]interface{}) []string

func (*QueryBuilder) BuildDeleteQuery

func (b *QueryBuilder) BuildDeleteQuery(table string, fields map[string]interface{}) string

func (*QueryBuilder) BuildInsertQuery

func (b *QueryBuilder) BuildInsertQuery(table *schema.Table, rows []map[string]interface{}) (string, error)

Jump to

Keyboard shortcuts

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