Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Col ¶
type Col struct {
// contains filtered or unexported fields
}
Col is the name and index of a column in a table
type ForeignKey ¶
type ForeignKey struct {
// contains filtered or unexported fields
}
ForeignKey represents a foreign key relationship the ForeignKey named "name" indicates that the columns "cols" on Table "foreignTable" references the primary key columns "cols" of "primaryTable"
type PrimaryKey ¶
type PrimaryKey struct {
// contains filtered or unexported fields
}
PrimaryKey is the name of a primary key field in a table
type Schema ¶
Schema represents a set of Tables and the tx log sequence number (XLogPos) at which they were fetched
func SyncSchema ¶
SyncSchema generates a simplified representation of the postgres schema It assumes that conn has the `replication` flag set so that it can fetch the current tx log sequence number, and will error if not.
func (*Schema) InternalMapping ¶
func (s *Schema) InternalMapping(external []config.TableMapping) []config.InternalTableMapping
InternalMapping converts a TableMapping config to an InternalTableMapping by using the information on the Schema.
func (*Schema) ToTableMapping ¶
func (s *Schema) ToTableMapping() []config.TableMapping
ToTableMapping generates a provisional TableMapping config based on an existing schema. This can be a good starting point for developing a postgres import config.
func (*Schema) ToZedSchema ¶
ToZedSchema generates an (example) zed schema for the postgres schema
type Table ¶
type Table struct { // ID is the int table identifier in postgres ID uint32 Name string PrimaryKeys PrimaryKey ForeignKeys []ForeignKey Cols []Col }
Table is associated with a set of PrimaryKeys and a set of ForeignKeys