// Copyright 2017-2018 gf Author(https://github.com/gogf/gf). All Rights Reserved. // // This Source Code Form is subject to the terms of the MIT License. // If a copy of the MIT was not distributed with this file, // You can obtain one at https://github.com/gogf/gf. package gdb import ( "bytes" "errors" "fmt" "github.com/gogf/gf/internal/empty" "github.com/gogf/gf/internal/utils" "github.com/gogf/gf/os/gtime" "reflect" "regexp" "strings" "time" "github.com/gogf/gf/internal/structs" "github.com/gogf/gf/text/gregex" "github.com/gogf/gf/text/gstr" "github.com/gogf/gf/util/gconv" ) // apiString is the type assert api for String. type apiString interface { String() string } // apiIterator is the type assert api for Iterator. type apiIterator interface { Iterator(f func(key, value interface{}) bool) } // apiInterfaces is the type assert api for Interfaces. type apiInterfaces interface { Interfaces() []interface{} } // apiMapStrAny is the interface support for converting struct parameter to map. type apiMapStrAny interface { MapStrAny() map[string]interface{} } const ( ORM_TAG_FOR_STRUCT = "orm" ORM_TAG_FOR_UNIQUE = "unique" ORM_TAG_FOR_PRIMARY = "primary" ) var ( // quoteWordReg is the regular expression object for a word check. quoteWordReg = regexp.MustCompile(`^[a-zA-Z0-9\-_]+$`) ) // GetInsertOperationByOption returns proper insert option with given parameter