Documentation ¶
Index ¶
- func ParseTargetExpression(targetExpression string) (string, string)
- type Attribute
- func (a *Attribute) Children() []ddldiff.Diffable
- func (post *Attribute) Diff(other ddldiff.Diffable, context ddldiff.Context) []action.Action
- func (a *Attribute) Drop(context ddldiff.Context) []action.Action
- func (a *Attribute) IsEqual(other ddldiff.Diffable) bool
- func (a *Attribute) IsNativeType() bool
- type Batch
- func (b *Batch) ActionFromData(data string) (action.Action, error)
- func (b *Batch) AppendActions(actions []action.Action) error
- func (b *Batch) AppendData(data *string) error
- func (b *Batch) CreateFile() (*os.File, error)
- func (b *Batch) GetActions() ([]action.Action, error)
- func (b *Batch) GetData() (*string, error)
- func (b *Batch) GetFile() (*os.File, error)
- func (b *Batch) GetFileReader() (*bufio.Reader, *os.File, error)
- func (b *Batch) InsertQuery(tx *sqlx.Tx) error
- func (b *Batch) PurgeData() error
- func (b *Batch) ReadAction(reader *bufio.Reader) (action.Action, error)
- func (b *Batch) SetActions(actions []action.Action) error
- func (b *Batch) SetData(data *string) error
- func (b *Batch) UpdateQuery(tx *sqlx.Tx) error
- type Column
- type Database
- func (db *Database) ConnectionString() string
- func (db Database) DBVersion() (string, error)
- func (db *Database) GetBatch(id string) (*Batch, error)
- func (db *Database) GetBatches(status, dataStatus string) ([]*Batch, error)
- func (db *Database) GetEvent(id string) (*Event, error)
- func (db *Database) GetEvents(status string, limit int) ([]*Event, error)
- func (db Database) InstallDDLTriggers(useEventTriggers bool)
- func (db *Database) InstallTriggers(targetExpression string)
- func (db *Database) NewTransaction() *sqlx.Tx
- func (db *Database) RefreshSchema() error
- func (db *Database) Start() error
- type Ddl
- type Dml
- type Enum
- type Event
- type Events
- type Extension
- type Function
- type Index
- type Schema
- type Schemas
- type Table
- func (c *Table) Children() []ddldiff.Diffable
- func (post *Table) Diff(other ddldiff.Diffable, context ddldiff.Context) []action.Action
- func (c *Table) Drop(context ddldiff.Context) []action.Action
- func (c *Table) GetPrimaryKey() *Column
- func (c *Table) InstallTriggers() error
- func (c *Table) IsEqual(other ddldiff.Diffable) bool
- type Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseTargetExpression ¶
Types ¶
type Attribute ¶
type Attribute struct { Name string `json:"attr_name"` Num int `json:"attr_num"` TypeName string `json:"type_name"` TypeSchema string `json:"type_schema"` TypeOid string `json:"type_oid"` Type *Type }
Define a class column
func (*Attribute) IsNativeType ¶
type Batch ¶
type Batch struct { Id string `db:"id" json:"id"` Status string `db:"status" json:"status"` DataStatus string `db:"data_status" json:"data_status"` Source string `db:"source" json:"source"` Target string `db:"target" json:"target"` Data *string `db:"data" json:"data"` StorageType string `db:"storage_type" json:"storage_type"` WaitingReexecution bool `db:"waiting_reexecution" json:"waiting_reexecution"` LastExecutedStatement int `db:"last_executed_statement" json:"last_executed_statement"` }
func (*Batch) AppendData ¶
type Column ¶
type Column struct { Name string `json:"attr_name"` Num int `json:"attr_num"` TypeName string `json:"type_name"` TypeSchema string `json:"type_schema"` TypeOid string `json:"type_oid"` IsPrimaryKey bool `json:"is_primary_key"` Table *Table }
Define a class column
func (*Column) IsNativeType ¶
type Database ¶
Database definition
func (*Database) ConnectionString ¶
func (*Database) GetBatches ¶
func (Database) InstallDDLTriggers ¶
Install DDL triggers
func (*Database) InstallTriggers ¶
Install triggers on a source table
func (*Database) NewTransaction ¶
func (*Database) RefreshSchema ¶
Fetches the schema from the database and update Schema
type Ddl ¶
type Dml ¶
type Dml struct { Pre *map[string]interface{} `json:"pre"` Post *map[string]interface{} `json:"post"` Event *Event Db *Database TargetSchema string }
func (*Dml) GetSchemaName ¶
func (*Dml) GetTableName ¶
type Event ¶
type Extension ¶
type Extension struct { Oid string `json:"oid"` Name string `json:"extension_name"` Schema *Schema }
type Function ¶
type Function struct { Oid string `json:"oid"` Name string `json:"function_name"` Def string `json:"function_def"` Arguments string `json:"function_arguments"` Schema *Schema }
type Index ¶
type Index struct { Oid string `json:"index_oid"` Name string `json:"index_name"` Def string `json:"index_def"` Table *Table }
Define a class column
type Schema ¶
type Schema struct { Oid string `json:"oid"` Name string `json:"schema_name"` Tables []*Table `json:"classes"` Types []*Type `json:"types"` Functions []*Function `json:"functions"` Extensions []*Extension `json:"extensions"` Db *Database }
Define a database schema
type Table ¶
type Table struct { Oid string `json:"oid"` RelationKind string `json:"relation_kind"` RelationName string `json:"relation_name"` Columns []*Column `json:"columns"` Indexes []*Index `json:"indexes"` Schema *Schema }
Define a database table
func (*Table) GetPrimaryKey ¶
func (*Table) InstallTriggers ¶
Click to show internal directories.
Click to hide internal directories.