Documentation ¶
Index ¶
- Constants
- Variables
- func AddItemsToPool(db *DBConnection, sql string, cols int, pool [][]interface{}) ([][]interface{}, error)
- func CheckReplaceNonUtf8Characters(b []byte, onlyCheck bool) ([]byte, string)
- func CheckReplaceNonUtf8CharactersInStringArray(m []string, onlyCheck bool) string
- func CheckReplaceNonUtf8CharactersInStringArrayOfArray(m [][]string, onlyCheck bool) string
- func CollectAllChildInfo(tableId string, data [][]interface{}, r map[string]map[string]int) error
- func ConvertListToBooleanMap(ids []string) map[string]bool
- func CreateTableByDefinition(db *DBConnection, def string) error
- func ExecuteSqlData(db *DBConnection, data []byte) error
- func ExecuteSqlFromFile(db *DBConnection, fileName string) error
- func ExecuteSqlFromFolder(db *DBConnection, root string) error
- func FindIdsPlaceholder(s string) (outerStart int, outerFinish int, innerStart int, innerFinish int)
- func FindIntInIntArray(val int, data []int) int
- func GetColumnListFromMetaByIndices(meta *TableMetaData, indices []int) string
- func GetComplexIdForItem(row []string, ids []int) string
- func GetConnectionKindMask(kind string) int
- func GetConnectionType(connName string) int
- func GetDBConnectionDirect(props map[string]string, connName string) (*sql.DB, string, error)
- func GetDateNowFunction(sqlType int) string
- func GetDefaultDbConnection() string
- func GetExistingItems(meta *TableMetaData, ids [][]string, db *DBConnection) ([]string, error)
- func GetHexValue(b byte) string
- func GetIdsFromItems(meta *TableMetaData, items [][]string) [][]string
- func GetMetaInfo(meta *TableMetaData) string
- func GetPropertyGlobalDefinition(props map[string]string) string
- func GetSingleValuesFromString(data [][]string, column int) []string
- func GetSqlQueryForGettingRowById(metaInfo *TableMetaData, columns string) (start string, finish string, cols int, err error)
- func GetSqlTableByIds(db *DBConnection, tableId string, ids []string) ([][]interface{}, error)
- func GetSqlTableByQuery(db *DBConnection, ids []string, query string) ([][]interface{}, error)
- func GetTableNameColumnsFromDefinition(def string) (table string, columns []string, colDef []string, err error)
- func GetTimestampLessDay(sqlType int) string
- func InitByGlobalProperties()
- func OrderObjectsByHierarchy(objects [][]string, leftObjects map[string]bool, idCol int, depCols []int) ([][][]string, error)
- func PlaceStringToSqlQuery(v string, tp string, b []byte, options int) ([]byte, error)
- func PreExecute(properties map[string]string) error
- func PreExecuteCsvFile(conn *DBConnection, name string, options int) error
- func PreExecuteForNewerVersions(props map[string]string, db *DBConnection, folder string) error
- func ReadGlobalDBProperty(props map[string]string, db *DBConnection, name string, defValue string) (string, error)
- func ReadItemsInBatches(db *DBConnection, start string, finish string, ids []string, cols int) ([][]interface{}, error)
- func ReadItemsInBulk(db *DBConnection, query string, cols int) ([][]interface{}, error)
- func SavePortionOfItems(items [][]string, sqlTable string, conn *DBConnection, left map[string]bool, ...) error
- func SplitSqlSequences(data []byte) []string
- func SqlInit(command string, ctx *dvcontext.RequestContext) ([]interface{}, bool)
- func SqlRun(data []interface{}) bool
- func SqlSingleValueByConnection(db *DBConnection, query string) (string, bool, error)
- func SqlSingleValueByConnectionName(connName string, query string) (string, bool, error)
- func SqlUpdateByConnection(db *DBConnection, query string) error
- func SqlUpdateByConnectionName(connName string, query string) error
- func WriteGlobalDBProperty(props map[string]string, db *DBConnection, name string, value string) error
- type DBConnection
- type SqlAction
- type TableMetaData
Constants ¶
View Source
const ( SqlOracleLike = 1 SqlPostgresLike = 2 SqlTraceError = 128 CommonMaxBatch = 1000 ComplexIdSeparator = "_._" )
View Source
const ( TypeDate = "Date" TypeInt = "int" TypeInt64 = "int64" TypeString = "string" TypeBool = "bool" )
View Source
const ( IdsPlaceholderStart = "${" IdsPlaceholderFinish = "IDS}" )
View Source
const ( SqlKindUpdate = 0 SqlKindSingle = 1 SqlKindRow = 2 SqlKindTable = 3 SqlKindList = 4 SqlKindRowText = 5 SqlKindTableText = 6 )
Variables ¶
View Source
var MaxConnections = 20
View Source
var NullStringAsBytes = []byte("NULL")
Functions ¶
func AddItemsToPool ¶
func AddItemsToPool(db *DBConnection, sql string, cols int, pool [][]interface{}) ([][]interface{}, error)
func CheckReplaceNonUtf8Characters ¶ added in v1.0.2
func CheckReplaceNonUtf8CharactersInStringArray ¶ added in v1.0.2
func CheckReplaceNonUtf8CharactersInStringArrayOfArray ¶ added in v1.0.2
func CollectAllChildInfo ¶ added in v1.0.2
func ConvertListToBooleanMap ¶
func CreateTableByDefinition ¶
func CreateTableByDefinition(db *DBConnection, def string) error
func ExecuteSqlData ¶
func ExecuteSqlData(db *DBConnection, data []byte) error
func ExecuteSqlFromFile ¶
func ExecuteSqlFromFile(db *DBConnection, fileName string) error
func ExecuteSqlFromFolder ¶
func ExecuteSqlFromFolder(db *DBConnection, root string) error
func FindIdsPlaceholder ¶ added in v1.0.2
func FindIntInIntArray ¶
func GetColumnListFromMetaByIndices ¶
func GetColumnListFromMetaByIndices(meta *TableMetaData, indices []int) string
func GetComplexIdForItem ¶
func GetConnectionKindMask ¶ added in v1.0.2
func GetConnectionType ¶
func GetDBConnectionDirect ¶
func GetDateNowFunction ¶
func GetDefaultDbConnection ¶
func GetDefaultDbConnection() string
func GetExistingItems ¶
func GetExistingItems(meta *TableMetaData, ids [][]string, db *DBConnection) ([]string, error)
func GetHexValue ¶ added in v1.0.2
func GetIdsFromItems ¶
func GetIdsFromItems(meta *TableMetaData, items [][]string) [][]string
func GetMetaInfo ¶
func GetMetaInfo(meta *TableMetaData) string
func GetSqlQueryForGettingRowById ¶ added in v1.0.2
func GetSqlTableByIds ¶ added in v1.0.2
func GetSqlTableByIds(db *DBConnection, tableId string, ids []string) ([][]interface{}, error)
func GetSqlTableByQuery ¶ added in v1.0.2
func GetSqlTableByQuery(db *DBConnection, ids []string, query string) ([][]interface{}, error)
func GetTimestampLessDay ¶
func InitByGlobalProperties ¶ added in v1.0.2
func InitByGlobalProperties()
func OrderObjectsByHierarchy ¶
func PlaceStringToSqlQuery ¶
func PreExecute ¶
func PreExecuteCsvFile ¶
func PreExecuteCsvFile(conn *DBConnection, name string, options int) error
func PreExecuteForNewerVersions ¶
func PreExecuteForNewerVersions(props map[string]string, db *DBConnection, folder string) error
func ReadGlobalDBProperty ¶
func ReadItemsInBatches ¶
func ReadItemsInBulk ¶ added in v1.0.2
func ReadItemsInBulk(db *DBConnection, query string, cols int) ([][]interface{}, error)
func SavePortionOfItems ¶
func SplitSqlSequences ¶
func SqlSingleValueByConnection ¶
func SqlSingleValueByConnection(db *DBConnection, query string) (string, bool, error)
func SqlUpdateByConnection ¶
func SqlUpdateByConnection(db *DBConnection, query string) error
func WriteGlobalDBProperty ¶
Types ¶
type DBConnection ¶ added in v1.0.2
func GetDBConnection ¶
func GetDBConnection(connName string) (r *DBConnection, err error)
func (*DBConnection) Close ¶ added in v1.0.2
func (db *DBConnection) Close(forced bool) (err error)
type SqlAction ¶
type SqlAction struct { Db string `json:"db"` Query string `json:"query"` QueryOracle string `json:"queryOracle"` QueryPostgres string `json:"queryPostgres"` Result string `json:"result"` Kind string `json:"kind"` Columns []string `json:"columns"` EmptyErrorCode int `json:"emptyErrCode"` Error string `json:"error"` KindNo int }
type TableMetaData ¶
type TableMetaData struct { Id string `json:"id"` Name string `json:"name"` Dependencies []int `json:"dependencies"` IdColumns []int `json:"idColumns"` MajorColumn int `json:"majorColumn"` Types []string `json:"types"` Columns []string `json:"columns"` References []string `json:"references"` QuoteColumns bool `json:"quoteColumns"` }
func ReadTableMetaData ¶
func ReadTableMetaData(table string, props map[string]string) (*TableMetaData, error)
func ReadTableMetaDataFromGlobal ¶ added in v1.0.2
func ReadTableMetaDataFromGlobal(tableId string) (*TableMetaData, error)
Click to show internal directories.
Click to hide internal directories.