Documentation ¶
Index ¶
- Constants
- func AndConditionFromArray(conditions []interface{ ... }) interface{ ... }
- func ConditionFromString(table *ReflectedTable, value string) interface{ ... }
- func OrConditionFromArray(conditions []interface{ ... }) interface{ ... }
- type AndCondition
- type ColumnCondition
- type ColumnConverter
- type ColumnIncluder
- type ColumnsBuilder
- func (cb *ColumnsBuilder) GetIncrement(table *ReflectedTable, columnValues map[string]interface{}) (string, []interface{})
- func (cb *ColumnsBuilder) GetInsert(table *ReflectedTable, columnValues map[string]interface{}) (string, []interface{})
- func (cb *ColumnsBuilder) GetOffsetLimit(offset, limit int) string
- func (cb *ColumnsBuilder) GetOrderBy(table *ReflectedTable, columnOrdering [][2]string) string
- func (cb *ColumnsBuilder) GetSelect(table *ReflectedTable, columnNames []string) string
- func (cb *ColumnsBuilder) GetUpdate(table *ReflectedTable, columnValues map[string]interface{}) (string, []interface{})
- type Condition
- type ConditionsBuilder
- type DataConverter
- type DefinitionService
- func (ds *DefinitionService) AddColumn(tableName string, definition map[string]interface{}) bool
- func (ds *DefinitionService) AddTable(definition map[string]interface{}) bool
- func (ds *DefinitionService) RemoveColumn(tableName, columnName string) bool
- func (ds *DefinitionService) RemoveTable(tableName string) bool
- func (ds *DefinitionService) UpdateColumn(tableName, columnName string, changes map[string]interface{}) bool
- func (ds *DefinitionService) UpdateTable(tableName string, changes map[string]interface{}) bool
- type GenericCondition
- type GenericDB
- func (g *GenericDB) BeginTransaction() (*sql.Tx, error)
- func (g *GenericDB) CommitTransaction(tx *sql.Tx) error
- func (g *GenericDB) CreateSingle(tx *sql.Tx, table *ReflectedTable, columnValues map[string]interface{}) (interface{}, error)
- func (g *GenericDB) Definition() *GenericDefinition
- func (g *GenericDB) DeleteSingle(tx *sql.Tx, table *ReflectedTable, id string) (int64, error)
- func (g *GenericDB) GetCacheKey() string
- func (g *GenericDB) IncrementSingle(tx *sql.Tx, table *ReflectedTable, columnValues map[string]interface{}, ...) (int64, error)
- func (g *GenericDB) PDO() *LazyPdo
- func (g *GenericDB) Ping() int
- func (g *GenericDB) Reconstruct(driver, address string, port int, database string, tables map[string]bool, ...) bool
- func (g *GenericDB) Reflection() *GenericReflection
- func (g *GenericDB) RollBackTransaction(tx *sql.Tx) error
- func (g *GenericDB) SelectAll(table *ReflectedTable, columnNames []string, condition interface{ ... }, ...) []map[string]interface{}
- func (g *GenericDB) SelectCount(table *ReflectedTable, condition interface{ ... }) int
- func (g *GenericDB) SelectMultiple(table *ReflectedTable, columnNames, ids []string) []map[string]interface{}
- func (g *GenericDB) SelectSingle(tx *sql.Tx, table *ReflectedTable, columnNames []string, id string) []map[string]interface{}
- func (g *GenericDB) UpdateSingle(tx *sql.Tx, table *ReflectedTable, columnValues map[string]interface{}, ...) (int64, error)
- type GenericDefinition
- func (gd *GenericDefinition) AddColumn(tableName string, newColumn *ReflectedColumn) error
- func (gd *GenericDefinition) AddColumnForeignKey(tableName, columnName string, newColumn *ReflectedColumn) error
- func (gd *GenericDefinition) AddColumnPrimaryKey(tableName, columnName string, newColumn *ReflectedColumn) error
- func (gd *GenericDefinition) AddTable(newTable *ReflectedTable) error
- func (gd *GenericDefinition) GetColumnType(column *ReflectedColumn, update bool) string
- func (gd *GenericDefinition) RemoveColumn(tableName, columnName string) error
- func (gd *GenericDefinition) RemoveColumnForeignKey(tableName, columnName string, newColumn *ReflectedColumn) error
- func (gd *GenericDefinition) RemoveColumnPrimaryKey(tableName, columnName string, newColumn *ReflectedColumn) error
- func (gd *GenericDefinition) RemoveTable(tableName string) error
- func (gd *GenericDefinition) RenameColumn(tableName, columnName string, newColumn *ReflectedColumn) error
- func (gd *GenericDefinition) RenameTable(tableName, newTableName string) error
- func (gd *GenericDefinition) RetypeColumn(tableName, columnName string, newColumn *ReflectedColumn) error
- func (gd *GenericDefinition) SetColumnNullable(tableName, columnName string, newColumn *ReflectedColumn) error
- type GenericReflection
- func (r *GenericReflection) GetDatabaseName() string
- func (r *GenericReflection) GetIgnoredTables() []string
- func (r *GenericReflection) GetTableColumns(tableName string, viewType string) []map[string]interface{}
- func (r *GenericReflection) GetTableForeignKeys(tableName string) map[string]string
- func (r *GenericReflection) GetTablePrimaryKeys(tableName string) []string
- func (r *GenericReflection) GetTables() []map[string]interface{}
- func (r *GenericReflection) ToJdbcType(jdbcType string, size string) string
- type LazyPdo
- func (l *LazyPdo) AddInitCommand(command string)
- func (l *LazyPdo) BeginTransaction() (*sql.Tx, error)
- func (l *LazyPdo) CloseConn()
- func (l *LazyPdo) Commit(tx *sql.Tx) error
- func (l *LazyPdo) Exec(tx *sql.Tx, req string, parameters ...interface{}) (sql.Result, error)
- func (l *LazyPdo) GetAttribute(attribute string) interface{}
- func (l *LazyPdo) InTransaction() bool
- func (l *LazyPdo) Query(tx *sql.Tx, req string, parameters ...interface{}) ([]map[string]interface{}, error)
- func (l *LazyPdo) QueryRowSingleColumn(tx *sql.Tx, req string, parameters ...interface{}) (interface{}, error)
- func (l *LazyPdo) Reconstruct(dsn string, user string, password string, options map[string]string) bool
- func (l *LazyPdo) RollBack(tx *sql.Tx) error
- func (l *LazyPdo) Rows2Map(rows *sql.Rows) ([]map[string]interface{}, error)
- func (l *LazyPdo) SetAttribute(attribute, value interface{}) bool
- type NoCondition
- type NotCondition
- type OrCondition
- type RealNameMapper
- func (rnm *RealNameMapper) GetColumnName(tableRealName, columnRealName string) string
- func (rnm *RealNameMapper) GetColumnRealName(tableName, columnName string) string
- func (rnm *RealNameMapper) GetTableName(tableRealName string) string
- func (rnm *RealNameMapper) GetTableRealName(tableName string) string
- type ReflectedColumn
- func NewReflectedColumn(name, realName, columnType string, length, precision, scale int, ...) *ReflectedColumn
- func NewReflectedColumnFromJson(json map[string]interface{}) *ReflectedColumn
- func NewReflectedColumnFromReflection(reflection *GenericReflection, columnResult map[string]interface{}) *ReflectedColumn
- func (rc *ReflectedColumn) GetFk() string
- func (rc *ReflectedColumn) GetLength() int
- func (rc *ReflectedColumn) GetName() string
- func (rc *ReflectedColumn) GetNullable() bool
- func (rc *ReflectedColumn) GetPk() bool
- func (rc *ReflectedColumn) GetPrecision() int
- func (rc *ReflectedColumn) GetRealName() string
- func (rc *ReflectedColumn) GetScale() int
- func (rc *ReflectedColumn) GetType() string
- func (rc *ReflectedColumn) HasLength() bool
- func (rc *ReflectedColumn) HasPrecision() bool
- func (rc *ReflectedColumn) HasScale() bool
- func (rc *ReflectedColumn) IsBinary() bool
- func (rc *ReflectedColumn) IsBoolean() bool
- func (rc *ReflectedColumn) IsGeometry() bool
- func (rc *ReflectedColumn) IsInteger() bool
- func (rc *ReflectedColumn) JsonSerialize() map[string]interface{}
- func (rt *ReflectedColumn) MarshalJSON() ([]byte, error)
- func (rc *ReflectedColumn) Serialize() map[string]interface{}
- func (rc *ReflectedColumn) SetFk(value string)
- func (rc *ReflectedColumn) SetPk(value bool)
- type ReflectedDatabase
- func (rd *ReflectedDatabase) GetRealName(tableName string) string
- func (rd *ReflectedDatabase) GetTableNames() []string
- func (rd *ReflectedDatabase) GetType(tableName string) string
- func (rd *ReflectedDatabase) HasTable(tableName string) bool
- func (rd *ReflectedDatabase) MarshalJSON() ([]byte, error)
- func (rd *ReflectedDatabase) RemoveTable(tableName string) bool
- func (rd *ReflectedDatabase) Serialize() map[string]interface{}
- type ReflectedTable
- func NewReflectedTable(name, realName, tableType string, columns map[string]*ReflectedColumn) *ReflectedTable
- func NewReflectedTableFromJson(json map[string]interface{}) *ReflectedTable
- func NewReflectedTableFromReflection(reflection *GenericReflection, name, realName, viewType string) *ReflectedTable
- func (rt *ReflectedTable) GetColumn(columnName string) *ReflectedColumn
- func (rt *ReflectedTable) GetColumnNames() []string
- func (rt *ReflectedTable) GetFksTo(tableName string) []*ReflectedColumn
- func (rt *ReflectedTable) GetName() string
- func (rt *ReflectedTable) GetPk() *ReflectedColumn
- func (rt *ReflectedTable) GetRealName() string
- func (rt *ReflectedTable) GetType() string
- func (rt *ReflectedTable) HasColumn(columnName string) bool
- func (rt *ReflectedTable) HasPk() bool
- func (rt *ReflectedTable) JsonSerialize() map[string]interface{}
- func (rt *ReflectedTable) MarshalJSON() ([]byte, error)
- func (rt *ReflectedTable) RemoveColumn(columnName string) bool
- func (rt *ReflectedTable) Serialize() map[string]interface{}
- type ReflectionService
- func (rs *ReflectionService) GetTable(tableName string) *ReflectedTable
- func (rs *ReflectionService) GetTableNames() []string
- func (rs *ReflectionService) GetType(tableName string) string
- func (rs *ReflectionService) HasTable(tableName string) bool
- func (rs *ReflectionService) RefreshTable(tableName string)
- func (rs *ReflectionService) RefreshTables()
- func (rs *ReflectionService) RemoveTable(tableName string) bool
- type SpatialCondition
- type TypeConverter
Constants ¶
View Source
const ( DEFAULT_LENGTH = 255 DEFAULT_PRECISION = 19 DEFAULT_SCALE = 4 )
Variables ¶
This section is empty.
Functions ¶
func AndConditionFromArray ¶
func ConditionFromString ¶
func ConditionFromString(table *ReflectedTable, value string) interface{ Condition }
func OrConditionFromArray ¶
Types ¶
type AndCondition ¶
type AndCondition struct { GenericCondition // contains filtered or unexported fields }
AndCondition struct
func NewAndCondition ¶
func NewAndCondition(condition1, condition2 interface{ Condition }) *AndCondition
func (*AndCondition) And ¶
func (ac *AndCondition) And(condition interface{}) interface{}
func (*AndCondition) GetConditions ¶
func (ac *AndCondition) GetConditions() []interface{ Condition }
func (*AndCondition) Or ¶
func (ac *AndCondition) Or(condition interface{}) interface{}
type ColumnCondition ¶
type ColumnCondition struct { GenericCondition // contains filtered or unexported fields }
ColumnCondition struct
func NewColumnCondition ¶
func NewColumnCondition(column *ReflectedColumn, operator, value string) *ColumnCondition
Ugly
func (*ColumnCondition) GetColumn ¶
func (cc *ColumnCondition) GetColumn() *ReflectedColumn
func (*ColumnCondition) GetOperator ¶
func (cc *ColumnCondition) GetOperator() string
func (*ColumnCondition) GetValue ¶
func (cc *ColumnCondition) GetValue() string
type ColumnConverter ¶
type ColumnConverter struct {
// contains filtered or unexported fields
}
func NewColumnConverter ¶
func NewColumnConverter(driver string) *ColumnConverter
func (*ColumnConverter) ConvertColumnName ¶
func (cc *ColumnConverter) ConvertColumnName(column *ReflectedColumn, value string) string
func (*ColumnConverter) ConvertColumnValue ¶
func (cc *ColumnConverter) ConvertColumnValue(column *ReflectedColumn, parameters []interface{}) string
type ColumnIncluder ¶
type ColumnIncluder struct { }
func (*ColumnIncluder) GetNames ¶
func (ci *ColumnIncluder) GetNames(table *ReflectedTable, primaryTable bool, params map[string][]string) []string
func (*ColumnIncluder) GetValues ¶
func (ci *ColumnIncluder) GetValues(table *ReflectedTable, primaryTable bool, record map[string]interface{}, params map[string][]string) map[string]interface{}
Not sure for property exists
type ColumnsBuilder ¶
type ColumnsBuilder struct {
// contains filtered or unexported fields
}
func NewColumnsBuilder ¶
func NewColumnsBuilder(driver string) *ColumnsBuilder
func (*ColumnsBuilder) GetIncrement ¶
func (cb *ColumnsBuilder) GetIncrement(table *ReflectedTable, columnValues map[string]interface{}) (string, []interface{})
func (*ColumnsBuilder) GetInsert ¶
func (cb *ColumnsBuilder) GetInsert(table *ReflectedTable, columnValues map[string]interface{}) (string, []interface{})
GetInsert return the insert request and the parameters to ensure to preserver column names and parameters order
func (*ColumnsBuilder) GetOffsetLimit ¶
func (cb *ColumnsBuilder) GetOffsetLimit(offset, limit int) string
func (*ColumnsBuilder) GetOrderBy ¶
func (cb *ColumnsBuilder) GetOrderBy(table *ReflectedTable, columnOrdering [][2]string) string
func (*ColumnsBuilder) GetSelect ¶
func (cb *ColumnsBuilder) GetSelect(table *ReflectedTable, columnNames []string) string
done
func (*ColumnsBuilder) GetUpdate ¶
func (cb *ColumnsBuilder) GetUpdate(table *ReflectedTable, columnValues map[string]interface{}) (string, []interface{})
type Condition ¶
type Condition interface { GetCondition() interface{} And(condition interface{}) interface{} Or(condition interface{}) interface{} Not() interface{} }
Condition interface
type ConditionsBuilder ¶
type ConditionsBuilder struct {
// contains filtered or unexported fields
}
func NewConditionsBuilder ¶
func NewConditionsBuilder(driver string) *ConditionsBuilder
func (*ConditionsBuilder) GetWhereClause ¶
func (cb *ConditionsBuilder) GetWhereClause(condition interface{ Condition }, arguments *[]interface{}) string
type DataConverter ¶
type DataConverter struct {
// contains filtered or unexported fields
}
func NewDataConverter ¶
func NewDataConverter(driver string) *DataConverter
func (*DataConverter) ConvertColumnValues ¶
func (dc *DataConverter) ConvertColumnValues(table *ReflectedTable, columnValues *map[string]interface{})
func (*DataConverter) ConvertRecords ¶
func (dc *DataConverter) ConvertRecords(table *ReflectedTable, columnNames []string, records *[]map[string]interface{})
Something nasty here in type conversion
type DefinitionService ¶
type DefinitionService struct {
// contains filtered or unexported fields
}
func NewDefinitionService ¶
func NewDefinitionService(db *GenericDB, reflection *ReflectionService) *DefinitionService
func (*DefinitionService) AddColumn ¶
func (ds *DefinitionService) AddColumn(tableName string, definition map[string]interface{}) bool
func (*DefinitionService) AddTable ¶
func (ds *DefinitionService) AddTable(definition map[string]interface{}) bool
func (*DefinitionService) RemoveColumn ¶
func (ds *DefinitionService) RemoveColumn(tableName, columnName string) bool
func (*DefinitionService) RemoveTable ¶
func (ds *DefinitionService) RemoveTable(tableName string) bool
func (*DefinitionService) UpdateColumn ¶
func (ds *DefinitionService) UpdateColumn(tableName, columnName string, changes map[string]interface{}) bool
func (*DefinitionService) UpdateTable ¶
func (ds *DefinitionService) UpdateTable(tableName string, changes map[string]interface{}) bool
type GenericCondition ¶
type GenericCondition struct {
// contains filtered or unexported fields
}
func (*GenericCondition) And ¶
func (gc *GenericCondition) And(condition interface{}) interface{}
func (*GenericCondition) GetCondition ¶
func (gc *GenericCondition) GetCondition() interface{}
func (*GenericCondition) Not ¶
func (gc *GenericCondition) Not() interface{}
func (*GenericCondition) Or ¶
func (gc *GenericCondition) Or(condition interface{}) interface{}
type GenericDB ¶
type GenericDB struct { VariableStore *utils.VariableStore // contains filtered or unexported fields }
func NewGenericDB ¶
func (*GenericDB) CreateSingle ¶
func (*GenericDB) Definition ¶
func (g *GenericDB) Definition() *GenericDefinition
func (*GenericDB) DeleteSingle ¶
func (*GenericDB) GetCacheKey ¶
func (*GenericDB) IncrementSingle ¶
func (*GenericDB) Reconstruct ¶
func (*GenericDB) Reflection ¶
func (g *GenericDB) Reflection() *GenericReflection
func (*GenericDB) SelectAll ¶
func (g *GenericDB) SelectAll(table *ReflectedTable, columnNames []string, condition interface{ Condition }, columnOrdering [][2]string, offset, limit int) []map[string]interface{}
Should check error
func (*GenericDB) SelectCount ¶
func (g *GenericDB) SelectCount(table *ReflectedTable, condition interface{ Condition }) int
Should check error
func (*GenericDB) SelectMultiple ¶
func (g *GenericDB) SelectMultiple(table *ReflectedTable, columnNames, ids []string) []map[string]interface{}
Should check error
func (*GenericDB) SelectSingle ¶
func (g *GenericDB) SelectSingle(tx *sql.Tx, table *ReflectedTable, columnNames []string, id string) []map[string]interface{}
Should check error
func (*GenericDB) UpdateSingle ¶
type GenericDefinition ¶
type GenericDefinition struct {
// contains filtered or unexported fields
}
func NewGenericDefinition ¶
func NewGenericDefinition(pdo *LazyPdo, driver, database string, tables map[string]bool, mapper *RealNameMapper) *GenericDefinition
func (*GenericDefinition) AddColumn ¶
func (gd *GenericDefinition) AddColumn(tableName string, newColumn *ReflectedColumn) error
func (*GenericDefinition) AddColumnForeignKey ¶
func (gd *GenericDefinition) AddColumnForeignKey(tableName, columnName string, newColumn *ReflectedColumn) error
func (*GenericDefinition) AddColumnPrimaryKey ¶
func (gd *GenericDefinition) AddColumnPrimaryKey(tableName, columnName string, newColumn *ReflectedColumn) error
func (*GenericDefinition) AddTable ¶
func (gd *GenericDefinition) AddTable(newTable *ReflectedTable) error
func (*GenericDefinition) GetColumnType ¶
func (gd *GenericDefinition) GetColumnType(column *ReflectedColumn, update bool) string
func (*GenericDefinition) RemoveColumn ¶
func (gd *GenericDefinition) RemoveColumn(tableName, columnName string) error
func (*GenericDefinition) RemoveColumnForeignKey ¶
func (gd *GenericDefinition) RemoveColumnForeignKey(tableName, columnName string, newColumn *ReflectedColumn) error
func (*GenericDefinition) RemoveColumnPrimaryKey ¶
func (gd *GenericDefinition) RemoveColumnPrimaryKey(tableName, columnName string, newColumn *ReflectedColumn) error
func (*GenericDefinition) RemoveTable ¶
func (gd *GenericDefinition) RemoveTable(tableName string) error
func (*GenericDefinition) RenameColumn ¶
func (gd *GenericDefinition) RenameColumn(tableName, columnName string, newColumn *ReflectedColumn) error
func (*GenericDefinition) RenameTable ¶
func (gd *GenericDefinition) RenameTable(tableName, newTableName string) error
func (*GenericDefinition) RetypeColumn ¶
func (gd *GenericDefinition) RetypeColumn(tableName, columnName string, newColumn *ReflectedColumn) error
func (*GenericDefinition) SetColumnNullable ¶
func (gd *GenericDefinition) SetColumnNullable(tableName, columnName string, newColumn *ReflectedColumn) error
type GenericReflection ¶
type GenericReflection struct {
// contains filtered or unexported fields
}
func NewGenericReflection ¶
func NewGenericReflection(pdo *LazyPdo, driver string, database string, tables map[string]bool, mapper *RealNameMapper) *GenericReflection
func (*GenericReflection) GetDatabaseName ¶
func (r *GenericReflection) GetDatabaseName() string
func (*GenericReflection) GetIgnoredTables ¶
func (r *GenericReflection) GetIgnoredTables() []string
func (*GenericReflection) GetTableColumns ¶
func (r *GenericReflection) GetTableColumns(tableName string, viewType string) []map[string]interface{}
func (*GenericReflection) GetTableForeignKeys ¶
func (r *GenericReflection) GetTableForeignKeys(tableName string) map[string]string
func (*GenericReflection) GetTablePrimaryKeys ¶
func (r *GenericReflection) GetTablePrimaryKeys(tableName string) []string
func (*GenericReflection) GetTables ¶
func (r *GenericReflection) GetTables() []map[string]interface{}
func (*GenericReflection) ToJdbcType ¶
func (r *GenericReflection) ToJdbcType(jdbcType string, size string) string
type LazyPdo ¶
type LazyPdo struct {
// contains filtered or unexported fields
}
LazyPdo is a custom db client
func NewLazyPdo ¶
func (*LazyPdo) AddInitCommand ¶
func (*LazyPdo) GetAttribute ¶
func (*LazyPdo) QueryRowSingleColumn ¶
func (*LazyPdo) Reconstruct ¶
func (*LazyPdo) Rows2Map ¶
from https://kylewbanks.com/blog/query-result-to-map-in-golang
func (*LazyPdo) SetAttribute ¶
type NoCondition ¶
type NoCondition struct { }
NoCondition struct
func NewNoCondition ¶
func NewNoCondition() *NoCondition
func (*NoCondition) And ¶
func (nc *NoCondition) And(condition interface{}) interface{}
func (*NoCondition) GetCondition ¶
func (nc *NoCondition) GetCondition() interface{}
func (*NoCondition) Not ¶
func (nc *NoCondition) Not() interface{}
func (*NoCondition) Or ¶
func (nc *NoCondition) Or(condition interface{}) interface{}
type NotCondition ¶
type NotCondition struct { GenericCondition // contains filtered or unexported fields }
NotCondition struct
func NewNotCondition ¶
func NewNotCondition(condition interface{ Condition }) *NotCondition
func (*NotCondition) And ¶
func (nc *NotCondition) And(condition interface{}) interface{}
func (*NotCondition) GetCondition ¶
func (nc *NotCondition) GetCondition() interface{}
func (*NotCondition) Or ¶
func (nc *NotCondition) Or(condition interface{}) interface{}
type OrCondition ¶
type OrCondition struct { GenericCondition // contains filtered or unexported fields }
OrCondition struct
func NewOrCondition ¶
func NewOrCondition(condition1, condition2 interface{ Condition }) *OrCondition
func (*OrCondition) And ¶
func (oc *OrCondition) And(condition interface{}) interface{}
func (*OrCondition) GetConditions ¶
func (ac *OrCondition) GetConditions() []interface{ Condition }
func (*OrCondition) Or ¶
func (oc *OrCondition) Or(condition interface{}) interface{}
type RealNameMapper ¶
type RealNameMapper struct {
// contains filtered or unexported fields
}
func NewRealNameMapper ¶
func NewRealNameMapper(mapping map[string]string) *RealNameMapper
func (*RealNameMapper) GetColumnName ¶
func (rnm *RealNameMapper) GetColumnName(tableRealName, columnRealName string) string
func (*RealNameMapper) GetColumnRealName ¶
func (rnm *RealNameMapper) GetColumnRealName(tableName, columnName string) string
func (*RealNameMapper) GetTableName ¶
func (rnm *RealNameMapper) GetTableName(tableRealName string) string
func (*RealNameMapper) GetTableRealName ¶
func (rnm *RealNameMapper) GetTableRealName(tableName string) string
type ReflectedColumn ¶
type ReflectedColumn struct {
// contains filtered or unexported fields
}
func NewReflectedColumn ¶
func NewReflectedColumn(name, realName, columnType string, length, precision, scale int, nullable, pk bool, fk string) *ReflectedColumn
done
func NewReflectedColumnFromJson ¶
func NewReflectedColumnFromJson(json map[string]interface{}) *ReflectedColumn
func NewReflectedColumnFromReflection ¶
func NewReflectedColumnFromReflection(reflection *GenericReflection, columnResult map[string]interface{}) *ReflectedColumn
done
func (*ReflectedColumn) GetFk ¶
func (rc *ReflectedColumn) GetFk() string
func (*ReflectedColumn) GetLength ¶
func (rc *ReflectedColumn) GetLength() int
func (*ReflectedColumn) GetName ¶
func (rc *ReflectedColumn) GetName() string
func (*ReflectedColumn) GetNullable ¶
func (rc *ReflectedColumn) GetNullable() bool
func (*ReflectedColumn) GetPk ¶
func (rc *ReflectedColumn) GetPk() bool
func (*ReflectedColumn) GetPrecision ¶
func (rc *ReflectedColumn) GetPrecision() int
func (*ReflectedColumn) GetRealName ¶
func (rc *ReflectedColumn) GetRealName() string
func (*ReflectedColumn) GetScale ¶
func (rc *ReflectedColumn) GetScale() int
func (*ReflectedColumn) GetType ¶
func (rc *ReflectedColumn) GetType() string
func (*ReflectedColumn) HasLength ¶
func (rc *ReflectedColumn) HasLength() bool
func (*ReflectedColumn) HasPrecision ¶
func (rc *ReflectedColumn) HasPrecision() bool
func (*ReflectedColumn) HasScale ¶
func (rc *ReflectedColumn) HasScale() bool
func (*ReflectedColumn) IsBinary ¶
func (rc *ReflectedColumn) IsBinary() bool
func (*ReflectedColumn) IsBoolean ¶
func (rc *ReflectedColumn) IsBoolean() bool
func (*ReflectedColumn) IsGeometry ¶
func (rc *ReflectedColumn) IsGeometry() bool
func (*ReflectedColumn) IsInteger ¶
func (rc *ReflectedColumn) IsInteger() bool
func (*ReflectedColumn) JsonSerialize ¶
func (rc *ReflectedColumn) JsonSerialize() map[string]interface{}
func (*ReflectedColumn) MarshalJSON ¶
func (rt *ReflectedColumn) MarshalJSON() ([]byte, error)
json marshaling for struct ReflectedTable
func (*ReflectedColumn) Serialize ¶
func (rc *ReflectedColumn) Serialize() map[string]interface{}
func (*ReflectedColumn) SetFk ¶
func (rc *ReflectedColumn) SetFk(value string)
func (*ReflectedColumn) SetPk ¶
func (rc *ReflectedColumn) SetPk(value bool)
type ReflectedDatabase ¶
type ReflectedDatabase struct {
// contains filtered or unexported fields
}
func NewReflectedDatabase ¶
func NewReflectedDatabase(tableTypes, tableRealNames map[string]string) *ReflectedDatabase
func NewReflectedDatabaseFromJson ¶
func NewReflectedDatabaseFromJson(data string) *ReflectedDatabase
func NewReflectedDatabaseFromReflection ¶
func NewReflectedDatabaseFromReflection(reflection *GenericReflection) *ReflectedDatabase
done
func (*ReflectedDatabase) GetRealName ¶
func (rd *ReflectedDatabase) GetRealName(tableName string) string
func (*ReflectedDatabase) GetTableNames ¶
func (rd *ReflectedDatabase) GetTableNames() []string
func (*ReflectedDatabase) GetType ¶
func (rd *ReflectedDatabase) GetType(tableName string) string
func (*ReflectedDatabase) HasTable ¶
func (rd *ReflectedDatabase) HasTable(tableName string) bool
done
func (*ReflectedDatabase) MarshalJSON ¶
func (rd *ReflectedDatabase) MarshalJSON() ([]byte, error)
json marshaling for struct ReflectedDatabase
func (*ReflectedDatabase) RemoveTable ¶
func (rd *ReflectedDatabase) RemoveTable(tableName string) bool
func (*ReflectedDatabase) Serialize ¶
func (rd *ReflectedDatabase) Serialize() map[string]interface{}
type ReflectedTable ¶
type ReflectedTable struct {
// contains filtered or unexported fields
}
func NewReflectedTable ¶
func NewReflectedTable(name, realName, tableType string, columns map[string]*ReflectedColumn) *ReflectedTable
func NewReflectedTableFromJson ¶
func NewReflectedTableFromJson(json map[string]interface{}) *ReflectedTable
func NewReflectedTableFromReflection ¶
func NewReflectedTableFromReflection(reflection *GenericReflection, name, realName, viewType string) *ReflectedTable
done
func (*ReflectedTable) GetColumn ¶
func (rt *ReflectedTable) GetColumn(columnName string) *ReflectedColumn
func (*ReflectedTable) GetColumnNames ¶
func (rt *ReflectedTable) GetColumnNames() []string
func (*ReflectedTable) GetFksTo ¶
func (rt *ReflectedTable) GetFksTo(tableName string) []*ReflectedColumn
func (*ReflectedTable) GetName ¶
func (rt *ReflectedTable) GetName() string
func (*ReflectedTable) GetPk ¶
func (rt *ReflectedTable) GetPk() *ReflectedColumn
func (*ReflectedTable) GetRealName ¶
func (rt *ReflectedTable) GetRealName() string
func (*ReflectedTable) GetType ¶
func (rt *ReflectedTable) GetType() string
func (*ReflectedTable) HasColumn ¶
func (rt *ReflectedTable) HasColumn(columnName string) bool
func (*ReflectedTable) HasPk ¶
func (rt *ReflectedTable) HasPk() bool
func (*ReflectedTable) JsonSerialize ¶
func (rt *ReflectedTable) JsonSerialize() map[string]interface{}
func (*ReflectedTable) MarshalJSON ¶
func (rt *ReflectedTable) MarshalJSON() ([]byte, error)
json marshaling for struct ReflectedTable
func (*ReflectedTable) RemoveColumn ¶
func (rt *ReflectedTable) RemoveColumn(columnName string) bool
func (*ReflectedTable) Serialize ¶
func (rt *ReflectedTable) Serialize() map[string]interface{}
type ReflectionService ¶
type ReflectionService struct {
// contains filtered or unexported fields
}
func NewReflectionService ¶
func NewReflectionService(db *GenericDB, lcache cache.Cache, ttl int32) *ReflectionService
func (*ReflectionService) GetTable ¶
func (rs *ReflectionService) GetTable(tableName string) *ReflectedTable
func (*ReflectionService) GetTableNames ¶
func (rs *ReflectionService) GetTableNames() []string
func (*ReflectionService) GetType ¶
func (rs *ReflectionService) GetType(tableName string) string
func (*ReflectionService) HasTable ¶
func (rs *ReflectionService) HasTable(tableName string) bool
func (*ReflectionService) RefreshTable ¶
func (rs *ReflectionService) RefreshTable(tableName string)
func (*ReflectionService) RefreshTables ¶
func (rs *ReflectionService) RefreshTables()
func (*ReflectionService) RemoveTable ¶
func (rs *ReflectionService) RemoveTable(tableName string) bool
type SpatialCondition ¶
type SpatialCondition struct {
ColumnCondition
}
SpatialCondition struct
func NewSpatialCondition ¶
func NewSpatialCondition(column *ReflectedColumn, operator, value string) *SpatialCondition
Ugly
func (*SpatialCondition) And ¶
func (sc *SpatialCondition) And(condition interface{}) interface{}
func (*SpatialCondition) Or ¶
func (sc *SpatialCondition) Or(condition interface{}) interface{}
type TypeConverter ¶
type TypeConverter struct {
// contains filtered or unexported fields
}
func NewTypeConverter ¶
func NewTypeConverter(driver string) *TypeConverter
func (*TypeConverter) FromJdbc ¶
func (t *TypeConverter) FromJdbc(jdbcType string) string
Source Files ¶
- columnconverter.go
- columnincluder.go
- columnsbuilder.go
- condition.go
- conditionsbuilder.go
- dataconverter.go
- definitionservice.go
- genericdb.go
- genericdefinition.go
- genericreflection.go
- lazypdo.go
- realnamemapper.go
- reflectedcolumn.go
- reflecteddatabase.go
- reflectedtable.go
- reflectionservice.go
- typeconverter.go
Click to show internal directories.
Click to hide internal directories.