Documentation ¶
Index ¶
- Variables
- func CleanupTasks() (err error)
- func InitDB()
- func Loop()
- func RemoveOld(table, conn, schemaName, tableName, columnName string) (err error)
- func Sync(table string, obj interface{}, fields ...string) (err error)
- type Headers
- type Job
- type QueryStatus
- type Row
- type Rows
- type SchemaTable
- type Session
- type TableColumn
- type TableColumnStats
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Db is the main databse connection Db *gorm.DB Dbx *sqlx.DB Conn database.Connection // DropAll signifies to drop all tables and recreate them DropAll = false )
Functions ¶
Types ¶
type Headers ¶
type Headers []string
type Job ¶
type Job struct { ID string `json:"id" gorm:"primaryKey"` Type string `json:"type" gorm:"index:idx_job_type"` Request g.Map `json:"request" gorm:"type:json default '{}'"` Time int64 `json:"time" gorm:"index:idx_job_time"` Duration float64 `json:"duration"` // Status sling.ExecStatus `json:"status"` Err string `json:"err"` Result g.Map `json:"result" gorm:"type:json default '{}'"` UpdatedDt time.Time `json:"updated_dt" gorm:"autoUpdateTime"` Context g.Context `json:"-" gorm:"-"` // Task *sling.TaskExecution `json:"-" gorm:"-"` Wait bool `json:"wait" gorm:"-"` Done chan struct{} `json:"-" gorm:"-"` }
Job represents a job
type QueryStatus ¶
type QueryStatus string
const QueryStatusCancelled QueryStatus = "cancelled"
const QueryStatusCompleted QueryStatus = "completed"
const QueryStatusErrored QueryStatus = "errored"
const QueryStatusFetched QueryStatus = "fetched"
const QueryStatusSubmitted QueryStatus = "submitted"
type Row ¶
type Row []interface{}
type Rows ¶
type Rows [][]interface{}
type SchemaTable ¶
type SchemaTable struct { Connection string `json:"connection" gorm:"primaryKey"` Database string `json:"database" gorm:"primaryKey"` SchemaName string `json:"schema_name" gorm:"primaryKey"` TableName string `json:"table_name" gorm:"primaryKey"` IsView bool `json:"is_view"` NumRows int64 `json:"num_rows"` UpdatedDt time.Time `json:"updated_dt" gorm:"autoUpdateTime"` }
SchemaTable represent a schema table/view
type Session ¶
type Session struct { Name string `json:"name" gorm:"primaryKey"` Data g.Map `json:"data" gorm:"type:json not null default '{}'"` CreatedDt time.Time `json:"created_dt" gorm:"autoCreateTime"` UpdatedDt time.Time `json:"updated_dt" gorm:"autoUpdateTime"` }
Session represents a connection session
type TableColumn ¶
type TableColumn struct { Connection string `json:"connection" gorm:"primaryKey"` Database string `json:"database" gorm:"primaryKey"` SchemaName string `json:"schema_name" gorm:"primaryKey"` TableName string `json:"table_name" gorm:"primaryKey"` TableIsView bool `json:"table_is_view"` Name string `json:"column_name" gorm:"primaryKey"` ID int `json:"column_id"` Type string `json:"column_type"` Precision int `json:"column_precision"` Scale int `json:"column_scale"` UpdatedDt time.Time `json:"updated_dt" gorm:"autoUpdateTime"` }
TableColumn is a table/view column
type TableColumnStats ¶
type TableColumnStats struct { Connection string `json:"connection" gorm:"primaryKey"` Database string `json:"database" gorm:"primaryKey"` SchemaName string `json:"schema_name" gorm:"primaryKey"` TableName string `json:"table_name" gorm:"primaryKey"` ColumnName string `json:"column_name" gorm:"primaryKey"` NumRows int64 `json:"num_rows"` NumValues int64 `json:"num_values"` NumDistinct int64 `json:"num_distinct"` NumNulls int64 `json:"num_nulls"` MinLen int `json:"min_len"` MaxLen int `json:"max_len"` LastAnalyzed time.Time `json:"last_analyzed"` UpdatedDt time.Time `json:"updated_dt" gorm:"autoUpdateTime"` }
TableColumnStats is a table/view column statistics record is separate from TableColumn to keep analysis values when hard refreshing
Click to show internal directories.
Click to hide internal directories.