Documentation ¶
Index ¶
- func FormatForSQL(datatype string, value interface{}) string
- func Quote(str string) string
- type AssRow
- type Db
- func (db *Db) BuildIdMap(idxkey string, rows Rows) (map[int64]AssRow, error)
- func (db *Db) ClearImportSchema(filename string)
- func (db *Db) Close()
- func (db *Db) CreateTable(t TableInfo) error
- func (db *Db) GenerateSchemaTemplate(templateFilename string, generatedFilename string) error
- func (db *Db) GenerateTableTemplates(templateFilename string, outputFolder string, extension string) error
- func (db *Db) GetSchema() ([]TableInfo, error)
- func (db *Db) ImportSchema(filename string)
- func (db *Db) ListSequences() (Rows, error)
- func (db *Db) ListTables() (Rows, error)
- func (db *Db) QueryAssociativeArray(query string) (Rows, error)
- func (db *Db) SaveSchema(generatedFilename string) error
- func (db *Db) Table(name string) *TableInfo
- type Link
- type Rows
- type TableInfo
- func (t *TableInfo) AddColumn(name string, sqltype string, comment string) error
- func (t *TableInfo) Delete(record AssRow) error
- func (t *TableInfo) DeleteColumn(name string) error
- func (t *TableInfo) DeleteTable() error
- func (t *TableInfo) GetAssociativeArray(columns []string, restriction string, sortkeys []string, dir string) ([]AssRow, error)
- func (t *TableInfo) GetSchema() (*TableInfo, error)
- func (t *TableInfo) Insert(record AssRow) (int64, error)
- func (t *TableInfo) Update(record AssRow) error
- func (t *TableInfo) UpdateOrInsert(record AssRow) (int64, error)
- func (t *TableInfo) WildDelete(restriction string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatForSQL ¶
Types ¶
type Db ¶
type Db struct { Driver string Url string LogQueries bool // contains filtered or unexported fields }
func (*Db) BuildIdMap ¶
Build a map based on id from a query result
func (*Db) ClearImportSchema ¶
func (*Db) CreateTable ¶
func (*Db) GenerateSchemaTemplate ¶
Generate templates from a schema
func (*Db) GenerateTableTemplates ¶
func (db *Db) GenerateTableTemplates(templateFilename string, outputFolder string, extension string) error
Generate tables
func (*Db) ImportSchema ¶
func (*Db) ListSequences ¶
func (*Db) ListTables ¶
GetSchema : Provide database tables list
func (*Db) QueryAssociativeArray ¶
QueryAssociativeArray : Provide query result as an associative array
func (*Db) SaveSchema ¶
type TableInfo ¶
type TableInfo struct { Name string `json:"name"` Columns map[string]string `json:"columns"` // contains filtered or unexported fields }
Table is a table structure description
func (*TableInfo) DeleteColumn ¶
func (*TableInfo) DeleteTable ¶
func (*TableInfo) GetAssociativeArray ¶
func (t *TableInfo) GetAssociativeArray(columns []string, restriction string, sortkeys []string, dir string) ([]AssRow, error)
GetAssociativeArray : Provide table data as an associative array
func (*TableInfo) WildDelete ¶
Click to show internal directories.
Click to hide internal directories.