Documentation ¶
Index ¶
- Variables
- func ColumnNamesFromStruct(s interface{}, skip []string, prefix string) []string
- func ColumnNamesStringFromStruct(istruct interface{}, skip []string, prefix string) string
- func ConvertFieldName(i zreflect.Item) string
- func CustomizeQuery(query string, btype BaseType) string
- func FieldIndexForColumnName(s interface{}, skip []string, prefix, column string) int
- func FieldNamesToColumnFromStruct(s interface{}, skip []string, prefix string) (m map[string]string, primaryCol string)
- func ForEachColumn(s interface{}, skip []string, prefix string, got func(each ColumnInfo) bool)
- func QuoteString(str string) string
- func ReplaceQuestionMarkArguments(squery string, args ...interface{}) string
- func SanitizeString(str string) string
- func Scan[A any](a *A, value any) error
- func Value(a any) (d driver.Value, err error)
- type BaseType
- type ColumnInfo
- type InsertInfo
- type JSONStringArray
- type JSONStringArrayPtr
- type JSONer
- type QueryBase
- type UpsertInfo
- type UserIDer
Constants ¶
This section is empty.
Variables ¶
View Source
var (
AllreadyExistsError = errors.New("already exists")
)
Functions ¶
func ColumnNamesFromStruct ¶
func ConvertFieldName ¶
func CustomizeQuery ¶
CustomizeQuery can make a sqlite or psql (or other in future) query, replacing $x with ?x for sqlite. It also replaces $NOW, $SERIAL and $PRIMARY-INT-INC with what is needed for each DB type.
func FieldIndexForColumnName ¶
func ForEachColumn ¶
func ForEachColumn(s interface{}, skip []string, prefix string, got func(each ColumnInfo) bool)
func QuoteString ¶
func SanitizeString ¶
Types ¶
type ColumnInfo ¶
type ColumnInfo struct { zreflect.FieldInfo Column string IsPrimary bool IsUserID bool ColumnIndex int }
func FieldForColumnName ¶
func FieldForColumnName(s interface{}, skip []string, prefix, column string) (ColumnInfo, bool)
type InsertInfo ¶
type InsertInfo[S any] struct { UpsertInfo[S] DefCols []string }
InsertInfo can be simlified? Not used as upsert, oly insert
type JSONStringArray ¶
type JSONStringArray []string
type JSONStringArrayPtr ¶
type JSONStringArrayPtr []string
type UpsertInfo ¶
type UpsertInfo[S any] struct { Rows [][]S }
Click to show internal directories.
Click to hide internal directories.