-
Notifications
You must be signed in to change notification settings - Fork 0
/
interface.go
68 lines (56 loc) · 2.07 KB
/
interface.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
package rorm
import (
"context"
"database/sql"
)
type (
// RormEngine - Engine of Raw Query ORM Library
RormEngine interface {
SetTableOptions(tbCaseFormat, tbPrefix string)
SetIsMultiRows(state bool)
SetDB(db *sql.DB)
GetDB() *sql.DB
GetPreparedValues() []interface{}
GetMultiPreparedValues() [][]interface{}
PrepareData(ctx context.Context, command string, data interface{}) error
ExecuteCUDQuery(ctx context.Context, preparedValue ...interface{}) (int64, error)
Clear()
GenerateSelectQuery()
GenerateRawCUDQuery(command string, data interface{})
GetLastQuery() string
// GetResults() []map[string]string
// GetSingleResult() map[string]string
Select(col ...string) *Engine
SelectSum(col string, colAlias ...string) *Engine
SelectAverage(col string, colAlias ...string) *Engine
SelectMax(col string, colAlias ...string) *Engine
SelectMin(col string, colAlias ...string) *Engine
SelectCount(col string, colAlias ...string) *Engine
Where(col string, value interface{}, opt ...string) *Engine
WhereRaw(args string, value ...interface{}) *Engine
WhereIn(col string, listOfValues ...interface{}) *Engine
WhereNotIn(col string, listOfValues ...interface{}) *Engine
WhereLike(col, value string) *Engine
WhereBetween(col string, val1, val2 interface{})
WhereNotBetween(col string, val1, val2 interface{})
Or(col string, value interface{}, opt ...string) *Engine
OrIn(col string, listOfValues ...interface{}) *Engine
OrNotIn(col string, listOfValues ...interface{}) *Engine
OrLike(col, value string) *Engine
OrBetween(col string, val1, val2 interface{})
OrNotBetween(col string, val1, val2 interface{})
OrderBy(col, value string) *Engine
Asc(col string) *Engine
Desc(col string) *Engine
Limit(limit int, offset ...int) *Engine
From(tableName string) *Engine
SQLRaw(rawQuery string, values ...interface{}) *Engine
Get(pointerStruct interface{}) error
Insert(data interface{}) error
Update(data interface{}) error
Delete(data interface{}) error
}
// RormTransaction - Transaction Structure
RormTransaction struct {
}
)