Documentation
¶
Index ¶
- Constants
- type ActionType
- type CobraCmdFn
- type Column
- type ConnConfig
- type DbConfigOrigins
- type DbConstraint
- type DbDumpFilesMap
- type DbRow
- type DbRows
- type DbSchema
- type DbSequence
- type DbType
- type DiffKey
- type Entity
- type EntityType
- type MiddlewareFunc
- type MigAction
- type QueryResult
- type Response
- type SafeVar
- type Schema
- type StateTag
- type Table
- type TableSchema
Constants ¶
View Source
const ( ActionTypeCreate ActionType = "CREATE" ActionTypeDrop ActionType = "DROP" EntityTypeSchema EntityType = "SCHEMA" EntityTypeTable EntityType = "TABLE" EntityTypeColumn EntityType = "COLUMN" EntityTypeConstraint EntityType = "CONST" EntityTypeView EntityType = "VIEW" EntityTypeSequence EntityType = "SEQ" StateTagCS StateTag = "CS" StateTagPS StateTag = "PS" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionType ¶
type ActionType string
type CobraCmdFn ¶
type ConnConfig ¶ added in v0.5.1
type ConnConfig struct {
User string `json:"user"`
Driver string `json:"driver"`
Password string `json:"password"`
Host string `json:"host"`
Port string `json:"port"`
Database string `json:"dbname"`
Params map[string]string `json:"params"`
}
func NewDefaultPgConnConfig ¶ added in v0.5.1
func NewDefaultPgConnConfig() ConnConfig
type DbConfigOrigins ¶ added in v0.5.1
type DbConfigOrigins = map[string]ConnConfig
type DbConstraint ¶
type DbDumpFilesMap ¶
type DbSchema ¶
type DbSchema struct {
DbName string
Tables map[string]*TableSchema
Views map[string]*TableSchema
Types []DbType
Schemas []Schema
Sequences []DbSequence
}
the string key is of format "schema.table"
type DbSequence ¶
type Entity ¶
type Entity struct {
Type EntityType
Id []string
// pointer to the real entity
Ptr interface{}
}
func NewEntity ¶
func NewEntity(entityType EntityType, entityPtr interface{}) Entity
func (*Entity) GetEntityId ¶
type EntityType ¶
type EntityType string
type MiddlewareFunc ¶
type MiddlewareFunc = func(fn CobraCmdFn) CobraCmdFn
type MigAction ¶
type MigAction struct {
ActionType ActionType
StateTag StateTag
Entity Entity
/*
For table, dep id is "schema.table", for col it's "schema.table.colname", for constraint/type it's "schema.name"
*/
DepArr []string
}
type QueryResult ¶
type SafeVar ¶
type SafeVar[T any] struct { // contains filtered or unexported fields }
func NewSafeVar ¶
type TableSchema ¶
type TableSchema struct {
Schema string
Name string
DefSyntax string // populated for only views
Columns []Column
Constraints []*DbConstraint
}
Click to show internal directories.
Click to hide internal directories.