Documentation ¶
Index ¶
- func Deserialize(raw interface{}, column Column) interface{}
- func GetCreateSchemaStatement(db *sql.DB, schemaName string) (error, string)
- func GetTablesFromDB(db *sql.DB, schema string) ([]string, error)
- type Column
- type ColumnValueString
- type Schema
- type SchemaStore
- type SimpleSchemaStore
- type Table
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Deserialize ¶
func Deserialize(raw interface{}, column Column) interface{}
Types ¶
type Column ¶
type Column struct { Idx int `json:"idx"` Name string `json:"name"` ColType string `json:"col_type"` DefaultVal ColumnValueString `json:"default_value_string"` IsNullable bool `json:"is_nullable"` IsUnsigned bool `json:"is_unsigned"` IsPrimaryKey bool `json:"is_primary_key"` }
Column
func (Column) EqualsDefault ¶
func (Column) IsDatetime ¶
func (Column) IsTimestamp ¶
type ColumnValueString ¶
ColumnValueString is the same as sql.NullString We define it here in case we want to extend it.
func (*ColumnValueString) Equals ¶
func (v1 *ColumnValueString) Equals(v2 *ColumnValueString) bool
type SchemaStore ¶
type SchemaStore interface { GetSchema(database string) (Schema, error) InvalidateSchemaCache(schema string) InvalidateCache() IsInCache(dbName string) bool Close() }
func NewSimpleSchemaStoreFromDBConn ¶
func NewSimpleSchemaStoreFromDBConn(db *sql.DB) (SchemaStore, error)
type SimpleSchemaStore ¶
func NewSimpleSchemaStore ¶
func NewSimpleSchemaStore(dbCfg *utils.DBConfig) (*SimpleSchemaStore, error)
func (*SimpleSchemaStore) Close ¶
func (store *SimpleSchemaStore) Close()
func (*SimpleSchemaStore) GetSchema ¶
func (store *SimpleSchemaStore) GetSchema(dbName string) (Schema, error)
func (*SimpleSchemaStore) InvalidateCache ¶
func (store *SimpleSchemaStore) InvalidateCache()
func (*SimpleSchemaStore) InvalidateSchemaCache ¶
func (store *SimpleSchemaStore) InvalidateSchemaCache(schema string)
func (*SimpleSchemaStore) IsInCache ¶
func (store *SimpleSchemaStore) IsInCache(dbName string) bool
type Table ¶
type Table struct { Version string `json:"version"` Schema string `json:"db_name"` Name string `json:"table_name"` Columns []Column `json:"columns"` PrimaryKeyColumns []Column `json:"primary_key_columns"` UniqueKeyColumnMap map[string][]string `json:"unique_key_columns"` // contains filtered or unexported fields }
Table
func GetTableDefFromDB ¶
func (*Table) ColumnNames ¶
func (*Table) MustColumn ¶
func (*Table) RenameColumn ¶
Click to show internal directories.
Click to hide internal directories.