Documentation ¶
Index ¶
- Constants
- func CallSql[R any](query string, core QueryRunnerInterface, args ...any) (int, string, string, []R, error)
- func ConvertJsonToStruct[Q any](row string) (Q, error)
- func Fill[Data any](query string, core QueryRunnerInterface, args ...any) ([]Data, string, string, error)
- func Filler[Data any](query string, core QueryRunnerInterface, args ...any) (Data, string, string, error)
- func GetQueryResp[R any](query string, core QueryRunnerInterface, args ...any) (int, string, string, bool, any, error)
- func HandleCheckDuplicate(code int, desc, dupDesc string, record []QueryData, err error) (int, string, error)
- func HandleCheckExistence(code int, desc, notExistDesc string, record []QueryData, err error) (int, string, error)
- func ParseCommand(command, user, app, action, title string, value map[string]string, ...) string
- func ParseQueryResult(result map[string]any, t reflect.Type, v reflect.Value)
- type DmlResult
- type FieldParser
- type Insertable
- type QueryData
- type QueryRunnerInterface
- type QueryRunnerModel
- func (m QueryRunnerModel) CallDbFunction(callString string, args ...any) (int, string, error)
- func (m QueryRunnerModel) GetModule() (string, string)
- func (m QueryRunnerModel) InsertRow(insert string, args ...any) (sql.Result, error)
- func (m QueryRunnerModel) QueryRunner(querySql string, args ...any) (int, []any, error)
- func (m QueryRunnerModel) QueryToStruct(querySql string, target any, args ...any) (int, any, error)
- type QueryWithDeps
- type RecordData
- type RecordDataDml
- type RecordDataGet
- type Updatable
Constants ¶
View Source
const ( PREPARE_ERROR = -1 QUERY_ERROR = -2 PARSE_ERROR = -3 SCAN_ERROR = -4 )
View Source
const ( NO_DATA_FOUND = "NO_DATA_FOUND" DB_READ_ERROR = "DB_READ_ERROR" PARSE_DB_RESP_ERROR = "PARSE_DB_RESP_ERROR" )
Variables ¶
This section is empty.
Functions ¶
func ConvertJsonToStruct ¶
func GetQueryResp ¶
func HandleCheckDuplicate ¶
func HandleCheckExistence ¶ added in v0.3.6
func ParseCommand ¶
func ParseCommand(command, user, app, action, title string, value map[string]string, parser FieldParser) string
Types ¶
type DmlResult ¶
type DmlResult struct { Rows map[string]string `json:"rows" form:"rows"` LastInsertId int64 `json:"lastId" form:"lastId"` RowsAffected int64 `json:"rowsAffected" form:"rowsAffected"` }
func (*DmlResult) LoadFromMap ¶
type FieldParser ¶
type Insertable ¶
type QueryRunnerInterface ¶
type QueryRunnerInterface interface { QueryRunner(querySql string, args ...any) (int, []any, error) QueryToStruct(querySql string, target any, args ...any) (int, any, error) CallDbFunction(callString string, args ...any) (int, string, error) GetModule() (string, string) InsertRow(insert string, args ...any) (sql.Result, error) }
type QueryRunnerModel ¶
func (QueryRunnerModel) CallDbFunction ¶
func (QueryRunnerModel) GetModule ¶
func (m QueryRunnerModel) GetModule() (string, string)
func (QueryRunnerModel) QueryRunner ¶
func (QueryRunnerModel) QueryToStruct ¶
type QueryWithDeps ¶
type QueryWithDeps interface {
GetFillable(core QueryRunnerInterface) (map[string]any, error)
}
type RecordData ¶
type RecordDataDml ¶
type RecordDataDml interface { SetId(string) CheckDuplicate(core QueryRunnerInterface) (int, string, error) Filler(headers map[string][]string, core QueryRunnerInterface, args ...any) (string, error) Post(core QueryRunnerInterface, args map[string]string) (DmlResult, int, string, error) CheckExistence(core QueryRunnerInterface) (int, string, error) PreControl(core QueryRunnerInterface) (int, string, error) Put(core QueryRunnerInterface, args map[string]string) (DmlResult, int, string, error) }
type RecordDataGet ¶
Click to show internal directories.
Click to hide internal directories.