2024-08-09 14:56:38 +00:00
|
|
|
package adapter
|
|
|
|
|
2024-08-11 14:29:42 +00:00
|
|
|
type Query struct {
|
2024-08-15 15:52:21 +00:00
|
|
|
Db string `json:"db"`
|
|
|
|
Expression string `json:"expr"`
|
|
|
|
Data []interface{} `json:"data"`
|
|
|
|
Transaction bool `json:"transaction"`
|
|
|
|
Exec bool `json:"exec"`
|
2024-08-11 14:29:42 +00:00
|
|
|
}
|
|
|
|
|
2024-08-11 19:49:19 +00:00
|
|
|
type DialectOpts map[string]string
|
2024-08-09 14:56:38 +00:00
|
|
|
|
2024-08-15 07:10:49 +00:00
|
|
|
/*
|
|
|
|
Dialect interface provides general utilities for normalizing values for particular DB.
|
|
|
|
*/
|
2024-08-11 19:49:19 +00:00
|
|
|
type Dialect interface {
|
|
|
|
New(opts DialectOpts) Dialect
|
2024-08-09 14:56:38 +00:00
|
|
|
GetTableName() string
|
2024-08-15 15:52:21 +00:00
|
|
|
GetTableAlias() string
|
2024-08-09 14:56:38 +00:00
|
|
|
GetFieldName() string
|
2024-08-09 19:14:28 +00:00
|
|
|
GetColumnName(key string) string
|
2024-08-09 14:56:38 +00:00
|
|
|
NormalizeValue(interface{}) interface{}
|
|
|
|
}
|