Documentation ¶
Index ¶
- func AddConstrantStatement(tableName string, constraint *types.KeyConstraint) string
- func AddForeignKeyStatement(tableName string, schemaForeignKey *schemasv1alpha4.PostgresqlTableForeignKey) string
- func AddIndexStatement(tableName string, schemaIndex *schemasv1alpha4.PostgresqlTableIndex) string
- func AlterColumnStatements(tableName string, primaryKeys []string, ...) ([]string, error)
- func CreateTableStatements(tableName string, tableSchema *schemasv1alpha4.PostgresqlTableSchema) ([]string, error)
- func DatabaseNameFromURI(uri string) (string, error)
- func DeployPostgresStatements(uri string, statements []string) error
- func InsertColumnStatement(tableName string, desiredColumn *schemasv1alpha4.PostgresqlTableColumn) (string, error)
- func PlanPostgresTable(uri string, tableName string, ...) ([]string, error)
- func RemoveConstraintStatement(tableName string, index *types.Index) string
- func RemoveConstrantStatement(tableName string, constraint *types.KeyConstraint) string
- func RemoveForeignKeyStatement(tableName string, foreignKey *types.ForeignKey) string
- func RemoveIndexStatement(tableName string, index *types.Index) string
- func RenameIndexStatement(tableName string, index *types.Index, ...) string
- func SeedDataStatements(tableName string, tableSchema *schemasv1alpha4.PostgresqlTableSchema, ...) ([]string, error)
- func UDTNameToDataType(udtName string) string
- type PostgresConnection
- func (p *PostgresConnection) Close() error
- func (p *PostgresConnection) DatabaseName() string
- func (p *PostgresConnection) EngineVersion() string
- func (p *PostgresConnection) GetTablePrimaryKey(tableName string) (*types.KeyConstraint, error)
- func (p *PostgresConnection) GetTableSchema(tableName string) ([]*types.Column, error)
- func (p *PostgresConnection) ListTableConstraints(databaseName string, tableName string) ([]string, error)
- func (p *PostgresConnection) ListTableForeignKeys(databaseName string, tableName string) ([]*types.ForeignKey, error)
- func (p *PostgresConnection) ListTableIndexes(databaseName string, tableName string) ([]*types.Index, error)
- func (p *PostgresConnection) ListTables() ([]*types.Table, error)
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 *schemasv1alpha4.PostgresqlTableForeignKey) string
func AddIndexStatement ¶ added in v0.2.0
func AddIndexStatement(tableName string, schemaIndex *schemasv1alpha4.PostgresqlTableIndex) string
func AlterColumnStatements ¶ added in v0.8.2
func AlterColumnStatements(tableName string, primaryKeys []string, desiredColumns []*schemasv1alpha4.PostgresqlTableColumn, existingColumn *types.Column) ([]string, error)
func CreateTableStatements ¶ added in v0.12.0
func CreateTableStatements(tableName string, tableSchema *schemasv1alpha4.PostgresqlTableSchema) ([]string, error)
func DatabaseNameFromURI ¶
func DeployPostgresStatements ¶ added in v0.8.0
func InsertColumnStatement ¶
func InsertColumnStatement(tableName string, desiredColumn *schemasv1alpha4.PostgresqlTableColumn) (string, error)
func PlanPostgresTable ¶ added in v0.8.0
func PlanPostgresTable(uri string, tableName string, postgresTableSchema *schemasv1alpha4.PostgresqlTableSchema, seedData *schemasv1alpha4.SeedData) ([]string, error)
func RemoveConstraintStatement ¶ added in v0.7.0
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 RenameIndexStatement ¶ added in v0.2.0
func RenameIndexStatement(tableName string, index *types.Index, schemaIndex *schemasv1alpha4.PostgresqlTableIndex) string
func SeedDataStatements ¶ added in v0.13.0
func SeedDataStatements(tableName string, tableSchema *schemasv1alpha4.PostgresqlTableSchema, seedData *schemasv1alpha4.SeedData) ([]string, error)
func UDTNameToDataType ¶ added in v0.8.0
This function only works for a few built-in types right now This needs a better design to make this work past basic arrays
Types ¶
type PostgresConnection ¶
type PostgresConnection struct {
// contains filtered or unexported fields
}
func Connect ¶
func Connect(uri string) (*PostgresConnection, error)
func (*PostgresConnection) Close ¶ added in v0.11.0
func (p *PostgresConnection) Close() error
func (*PostgresConnection) DatabaseName ¶
func (p *PostgresConnection) DatabaseName() string
func (*PostgresConnection) EngineVersion ¶
func (p *PostgresConnection) EngineVersion() string
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) ListTableConstraints ¶ added in v0.7.0
func (p *PostgresConnection) ListTableConstraints(databaseName string, tableName string) ([]string, 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 (*PostgresConnection) ListTables ¶
func (p *PostgresConnection) ListTables() ([]*types.Table, error)
Click to show internal directories.
Click to hide internal directories.