postgres

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2019 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddConstrantStatement added in v0.3.0

func AddConstrantStatement(tableName string, constraint *types.KeyConstraint) string

func AddForeignKeyStatement added in v0.2.0

func AddForeignKeyStatement(tableName string, schemaForeignKey *schemasv1alpha2.SQLTableForeignKey) string

func AddIndexStatement added in v0.2.0

func AddIndexStatement(tableName string, schemaIndex *schemasv1alpha2.SQLTableIndex) string

func AlterColumnStatement

func AlterColumnStatement(tableName string, primaryKeys []string, desiredColumns []*schemasv1alpha2.SQLTableColumn, existingColumn *types.Column) (string, error)

func CreateTableStatement

func CreateTableStatement(tableName string, tableSchema *schemasv1alpha2.SQLTableSchema) (string, error)

func DatabaseNameFromURI

func DatabaseNameFromURI(uri string) (string, error)

func DeployPostgresTable added in v0.2.0

func DeployPostgresTable(uri string, tableName string, postgresTableSchema *schemasv1alpha2.SQLTableSchema) error

func InsertColumnStatement

func InsertColumnStatement(tableName string, desiredColumn *schemasv1alpha2.SQLTableColumn) (string, error)

func RemoveConstrantStatement added in v0.3.0

func RemoveConstrantStatement(tableName string, constraint *types.KeyConstraint) string

func RemoveForeignKeyStatement added in v0.2.0

func RemoveForeignKeyStatement(tableName string, foreignKey *types.ForeignKey) string

func RemoveIndexStatement added in v0.2.0

func RemoveIndexStatement(tableName string, index *types.Index) string

func RenameIndexStatement added in v0.2.0

func RenameIndexStatement(tableName string, index *types.Index, schemaIndex *schemasv1alpha2.SQLTableIndex) string

Types

type PostgresConnection

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

func Connect

func Connect(uri string) (*PostgresConnection, error)

func (*PostgresConnection) CheckAlive

func (p *PostgresConnection) CheckAlive(namespace string, instanceName string) (bool, error)

func (*PostgresConnection) DatabaseName

func (p *PostgresConnection) DatabaseName() string

func (*PostgresConnection) EngineVersion

func (p *PostgresConnection) EngineVersion() string

func (*PostgresConnection) GetConnection

func (p *PostgresConnection) GetConnection() *sql.Conn

func (*PostgresConnection) GetDB

func (p *PostgresConnection) GetDB() *sql.DB

func (*PostgresConnection) GetTablePrimaryKey

func (p *PostgresConnection) GetTablePrimaryKey(tableName string) (*types.KeyConstraint, error)

func (*PostgresConnection) GetTableSchema

func (p *PostgresConnection) GetTableSchema(tableName string) ([]*types.Column, error)

func (*PostgresConnection) ListTableForeignKeys added in v0.2.0

func (p *PostgresConnection) ListTableForeignKeys(databaseName string, tableName string) ([]*types.ForeignKey, error)

func (*PostgresConnection) ListTableIndexes added in v0.2.0

func (p *PostgresConnection) ListTableIndexes(databaseName string, tableName string) ([]*types.Index, error)

func (*PostgresConnection) ListTables

func (p *PostgresConnection) ListTables() ([]string, error)

Jump to

Keyboard shortcuts

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