postgresql

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const COMMAND_GENERATE = "generate"
View Source
const COMMAND_MIGRATE = "migrate"

Variables

View Source
var SchemaDatabase = sqlx.NewDatabase("INFORMATION_SCHEMA")

Functions

func InterpolateParams

func InterpolateParams(query string, args []driver.NamedValue, loc *time.Location) (string, error)

Types

type ColumnSchema

type ColumnSchema struct {
	TABLE_SCHEMA             string `db:"table_schema"`
	TABLE_NAME               string `db:"table_name"`
	COLUMN_NAME              string `db:"column_name"`
	DATA_TYPE                string `db:"data_type"`
	IS_NULLABLE              string `db:"is_nullable"`
	COLUMN_DEFAULT           string `db:"column_default"`
	CHARACTER_MAXIMUM_LENGTH uint64 `db:"character_maximum_length"`
	NUMERIC_PRECISION        uint64 `db:"numeric_precision"`
	NUMERIC_SCALE            uint64 `db:"numeric_scale"`
}

func (ColumnSchema) TableName

func (ColumnSchema) TableName() string

type IndexSchema

type IndexSchema struct {
	TABLE_SCHEMA string `db:"schemaname"`
	TABLE_NAME   string `db:"tablename"`
	INDEX_NAME   string `db:"indexname"`
	INDEX_DEF    string `db:"indexdef"`
}

func (IndexSchema) TableName

func (IndexSchema) TableName() string

type PostgreSQLConnector

type PostgreSQLConnector struct {
	Host       string
	DBName     string
	Extra      string
	Extensions []string
}

func (*PostgreSQLConnector) AddColumn

func (c *PostgreSQLConnector) AddColumn(col *builder.Column) builder.SqlExpr

func (*PostgreSQLConnector) AddIndex

func (c *PostgreSQLConnector) AddIndex(key *builder.Key) builder.SqlExpr

func (*PostgreSQLConnector) Connect

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

func (*PostgreSQLConnector) CreateDatabase

func (c *PostgreSQLConnector) CreateDatabase(dbName string) builder.SqlExpr

func (*PostgreSQLConnector) CreateSchema

func (c *PostgreSQLConnector) CreateSchema(schema string) builder.SqlExpr

func (*PostgreSQLConnector) CreateTableIsNotExists

func (c *PostgreSQLConnector) CreateTableIsNotExists(t *builder.Table) (exprs []builder.SqlExpr)

func (*PostgreSQLConnector) DataType

func (c *PostgreSQLConnector) DataType(columnType *builder.ColumnType) builder.SqlExpr

func (PostgreSQLConnector) Driver

func (PostgreSQLConnector) DriverName

func (PostgreSQLConnector) DriverName() string

func (*PostgreSQLConnector) DropColumn

func (c *PostgreSQLConnector) DropColumn(col *builder.Column) builder.SqlExpr

func (*PostgreSQLConnector) DropDatabase

func (c *PostgreSQLConnector) DropDatabase(dbName string) builder.SqlExpr

func (*PostgreSQLConnector) DropIndex

func (c *PostgreSQLConnector) DropIndex(key *builder.Key) builder.SqlExpr

func (*PostgreSQLConnector) DropTable

func (c *PostgreSQLConnector) DropTable(t *builder.Table) builder.SqlExpr

func (*PostgreSQLConnector) Generate added in v1.0.2

func (c *PostgreSQLConnector) Generate(ctx context.Context, db sqlx.DBExecutor) error

func (PostgreSQLConnector) IsErrorConflict

func (PostgreSQLConnector) IsErrorConflict(err error) bool

func (PostgreSQLConnector) IsErrorUnknownDatabase

func (PostgreSQLConnector) IsErrorUnknownDatabase(err error) bool

func (*PostgreSQLConnector) Migrate

func (*PostgreSQLConnector) ModifyColumn

func (c *PostgreSQLConnector) ModifyColumn(col *builder.Column, prev *builder.Column) builder.SqlExpr

func (PostgreSQLConnector) PrimaryKeyName

func (PostgreSQLConnector) PrimaryKeyName() string

func (*PostgreSQLConnector) RenameColumn

func (c *PostgreSQLConnector) RenameColumn(col *builder.Column, target *builder.Column) builder.SqlExpr

func (*PostgreSQLConnector) TruncateTable

func (c *PostgreSQLConnector) TruncateTable(t *builder.Table) builder.SqlExpr

func (PostgreSQLConnector) WithDBName

func (c PostgreSQLConnector) WithDBName(dbName string) driver.Connector

type PostgreSQLLoggingDriver

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

func (*PostgreSQLLoggingDriver) Open

type PostgreSQLOpts

type PostgreSQLOpts map[string]string

func FromConfigString

func FromConfigString(s string) PostgreSQLOpts

func (PostgreSQLOpts) String

func (opts PostgreSQLOpts) String() string

type SqlPrinter

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

func (*SqlPrinter) String

func (p *SqlPrinter) String() string

Jump to

Keyboard shortcuts

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