ds

package
v0.0.0-...-6dc645d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 8, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultDbSecurityRules = module_model.SecurityRules{security_rule.SecurityRule{"Allow", emptyCustomRule}, security_rule.SecurityRule{"Deny", emptyCustomRule}, security_rule.SecurityRule{"Allow", emptyCustomRule}, security_rule.SecurityRule{"Allow", emptyCustomRule}, security_rule.SecurityRule{"Allow", emptyCustomRule}, security_rule.SecurityRule{"Deny", emptyCustomRule}, security_rule.SecurityRule{"Allow", emptyCustomRule}, security_rule.SecurityRule{"Allow", emptyCustomRule}}
View Source
var DefaultDriverConfig = module_model.DriverConfig{10, 2, time.Hour}
View Source
var DefaultOtherConfig = module_model.OtherDbConfig{1000, 60, false}

Functions

func GetDbType

func GetDbType(dbName string) string

func ParseAstValue

func ParseAstValue(ctx context.Context, value ast.Value, vars map[string]interface{}) (interface{}, error)

parseAstValue returns an interface that can be casted to string

Types

type GraphqlResult

type GraphqlResult struct {
	// contains filtered or unexported fields
}

type MssqlSqlMaker

type MssqlSqlMaker struct {
	SqlMaker
}

func (*MssqlSqlMaker) AddLimitSkipClause

func (mr *MssqlSqlMaker) AddLimitSkipClause(ctx context.Context, query string, limit int, skip int, globalLimit int) (newQuery string)

func (*MssqlSqlMaker) CheckMe

func (mr *MssqlSqlMaker) CheckMe(ctx context.Context)

func (*MssqlSqlMaker) CreateConn

func (mr *MssqlSqlMaker) CreateConn(ctx context.Context, dataSource *module_model.DataSource) error

func (*MssqlSqlMaker) GetTableMetaDataSQL

func (pr *MssqlSqlMaker) GetTableMetaDataSQL(ctx context.Context) string

type MysqlSqlMaker

type MysqlSqlMaker struct {
	SqlMaker
}

func (*MysqlSqlMaker) AddLimitSkipClause

func (pr *MysqlSqlMaker) AddLimitSkipClause(ctx context.Context, query string, limit int, skip int, globalLimit int) (newQuery string)

func (*MysqlSqlMaker) CheckMe

func (mr *MysqlSqlMaker) CheckMe(ctx context.Context)

func (*MysqlSqlMaker) CreateConn

func (mr *MysqlSqlMaker) CreateConn(ctx context.Context, dataSource *module_model.DataSource) error

func (*MysqlSqlMaker) GetTableMetaDataSQL

func (mr *MysqlSqlMaker) GetTableMetaDataSQL(ctx context.Context) string

type PostgresSqlMaker

type PostgresSqlMaker struct {
	SqlMaker
}

func (*PostgresSqlMaker) AddLimitSkipClause

func (pr *PostgresSqlMaker) AddLimitSkipClause(ctx context.Context, query string, limit int, skip int, globalLimit int) (newQuery string)

func (*PostgresSqlMaker) CheckMe

func (pr *PostgresSqlMaker) CheckMe(ctx context.Context)

func (*PostgresSqlMaker) CreateConn

func (pr *PostgresSqlMaker) CreateConn(ctx context.Context, dataSource *module_model.DataSource) error

func (*PostgresSqlMaker) GetPreparedQueryPlaceholder

func (pr *PostgresSqlMaker) GetPreparedQueryPlaceholder(ctx context.Context, rowCount int, colCount int, single bool) string

func (*PostgresSqlMaker) GetTableMetaDataSQL

func (pr *PostgresSqlMaker) GetTableMetaDataSQL(ctx context.Context) string

func (*PostgresSqlMaker) MakeCreateTableSQL

func (pr *PostgresSqlMaker) MakeCreateTableSQL(ctx context.Context, tableName string, tableObj map[string]module_model.TableColsMetaData) (string, error)

func (*PostgresSqlMaker) MakeDropTableSQL

func (pr *PostgresSqlMaker) MakeDropTableSQL(ctx context.Context, tableName string) (string, error)

type SqlMaker

type SqlMaker struct {
	TestFlag      bool
	QueryType     string
	MainTableName string
	MainAliasName string
	TableNames    map[string]string
	//AllTableNamesNew [][]tablesInQuery
	MainTableDB     string
	WhereClause     string
	SortClause      string
	ColumnList      string
	DBColumns       string
	GroupList       string
	JoinClause      string
	ChildChange     string
	Limit           int
	Skip            int
	HasAggregate    bool
	DistinctResults bool

	//tempRA               []map[int]int
	//tempA                map[int]int
	//t                    int
	//InsertData     []map[string]interface{}
	MutationRecords     []module_model.MutationRecord
	TxnFlag             bool
	MutationReturn      module_model.MutationReturn
	MutationSelectQuery string
	MutationSelectCols  string
	SingleTxn           bool

	IsNested      bool
	DBQuery       string
	PreparedQuery bool
	// contains filtered or unexported fields
}

func (*SqlMaker) AddLimitSkipClause

func (sqr *SqlMaker) AddLimitSkipClause(ctx context.Context, query string, limit int, skip int, globalLimit int) (newQuery string)

func (*SqlMaker) CheckMe

func (sqr *SqlMaker) CheckMe(ctx context.Context)

func (*SqlMaker) CreateConn

func (sqr *SqlMaker) CreateConn(ctx context.Context, dataSource *module_model.DataSource) error

func (*SqlMaker) ExecuteMutationQuery

func (sqr *SqlMaker) ExecuteMutationQuery(ctx context.Context, datasource *module_model.DataSource, myself SqlMakerI, mrm module_model.MutationResultMaker) (res []map[string]interface{}, err error)

func (*SqlMaker) ExecutePreparedQuery

func (sqr *SqlMaker) ExecutePreparedQuery(ctx context.Context, query string, datasource *module_model.DataSource) (res map[string]interface{}, err error)

func (*SqlMaker) ExecuteQuery

func (sqr *SqlMaker) ExecuteQuery(ctx context.Context, datasource *module_model.DataSource, qrm module_model.QueryResultMaker) (res map[string]interface{}, err error)

func (*SqlMaker) ExecuteQueryForCsv

func (sqr *SqlMaker) ExecuteQueryForCsv(ctx context.Context, query string, datasource *module_model.DataSource, aliasName string) (res map[string]interface{}, err error)

func (*SqlMaker) GetBaseSqlMaker

func (sqr *SqlMaker) GetBaseSqlMaker(ctx context.Context) *SqlMaker

func (*SqlMaker) GetPreparedQueryPlaceholder

func (sqr *SqlMaker) GetPreparedQueryPlaceholder(ctx context.Context, rowCount int, colCount int, single bool) string

func (*SqlMaker) GetReturnAlias

func (sqr *SqlMaker) GetReturnAlias(ctx context.Context) string

func (*SqlMaker) GetSqlResult

func (sqr *SqlMaker) GetSqlResult(ctx context.Context) map[string]interface{}

func (*SqlMaker) GetTableList

func (sqr *SqlMaker) GetTableList(ctx context.Context, query string, datasource *module_model.DataSource, myself SqlMakerI) (err error)

func (*SqlMaker) GetTableMetaDataSQL

func (sqr *SqlMaker) GetTableMetaDataSQL(ctx context.Context) string

func (*SqlMaker) MakeCreateTableSQL

func (sqr *SqlMaker) MakeCreateTableSQL(ctx context.Context, tableName string, tableObj map[string]module_model.TableColsMetaData) (string, error)

func (*SqlMaker) MakeDropTableSQL

func (sqr *SqlMaker) MakeDropTableSQL(ctx context.Context, tableName string) (string, error)

func (*SqlMaker) MakeQuery

func (sqr *SqlMaker) MakeQuery(ctx context.Context) (dbQuery string, err string)

func (*SqlMaker) RollbackQuery

func (sqr *SqlMaker) RollbackQuery(ctx context.Context) (err error)

type SqlMakerI

type SqlMakerI interface {
	GetReturnAlias(ctx context.Context) string
	GetBaseSqlMaker(ctx context.Context) *SqlMaker
	//ProcessGraphQL(sel ast.Selection, vars map[string]interface{}, myself SqlMakerI, datasource *model.DataSource, ExecuteFlag bool) (res map[string]interface{}, query string, cols string , err error)
	//ProcessMutationGraphQL(sel ast.Selection, vars map[string]interface{}, myself SqlMakerI, datasource *model.DataSource, singleTxn bool, openTxn bool, closeTxn bool, query string, cols string) (res map[string]interface{}, err error)
	CheckMe(ctx context.Context)
	MakeQuery(ctx context.Context) (dbQuery string, err string)
	//MakeSQLQuery(sqlObject ql.SQLObject) (dbQuery string, err string)
	//MakeMutationQuery(idx int, docs []MutationRecord, tableName string) (dbQuery string)
	AddLimitSkipClause(ctx context.Context, query string, limit int, skip int, globalLimit int) (newQuery string)
	CreateConn(ctx context.Context, dataSource *module_model.DataSource) error
	ExecuteQuery(ctx context.Context, datasource *module_model.DataSource, qrm module_model.QueryResultMaker) (res map[string]interface{}, err error)
	ExecuteMutationQuery(ctx context.Context, datasource *module_model.DataSource, myself SqlMakerI, mrm module_model.MutationResultMaker) (res []map[string]interface{}, err error)
	ExecutePreparedQuery(ctx context.Context, query string, datasource *module_model.DataSource) (res map[string]interface{}, err error)
	ExecuteQueryForCsv(ctx context.Context, query string, datasource *module_model.DataSource, aliasName string) (res map[string]interface{}, err error)
	RollbackQuery(ctx context.Context) (err error)
	GetTableList(ctx context.Context, query string, datasource *module_model.DataSource, myself SqlMakerI) (err error)
	GetTableMetaDataSQL(ctx context.Context) string
	MakeCreateTableSQL(ctx context.Context, tableName string, tableObj map[string]module_model.TableColsMetaData) (string, error)
	MakeDropTableSQL(ctx context.Context, tableName string) (string, error)

	GetSqlResult(ctx context.Context) map[string]interface{}
	GetPreparedQueryPlaceholder(ctx context.Context, rowCount int, colCount int, single bool) string
	// contains filtered or unexported methods
}

func GetSqlMaker

func GetSqlMaker(dbName string) SqlMakerI

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL