Documentation ¶
Index ¶
- Constants
- Variables
- func CreateInsert(data map[string]any) (string, string)
- func CreateTableStructure(fields []Field) string
- func CreateTsQuery(values ...any) string
- func CreateTsVector(values ...any) string
- func CreateUpdate(data map[string]any) string
- func Escape(value string) string
- func MapToTsVectorsValue[T any](m map[string]T) string
- func Normalize(value string) string
- func Nullable[T any](v T) sql.Null[T]
- func RemoveAccents(value string) string
- type Config
- func WithCertPath(certpath string) Config
- func WithDbname(dbname string) Config
- func WithDriver(driver string) Config
- func WithHost(host string) Config
- func WithLog(log bool) Config
- func WithMysql() Config
- func WithPassword(password string) Config
- func WithPort(port int) Config
- func WithPostgres() Config
- func WithSsl(sslmode string) Config
- func WithSslAllow() Config
- func WithSslDisable() Config
- func WithSslPrefer() Config
- func WithSslRequire() Config
- func WithSslVerifyCa() Config
- func WithSslVerifyFull() Config
- func WithTimeout(duration time.Duration) Config
- func WithUser(user string) Config
- type DB
- type Field
- type Jsonb
- type Map
- type Quirk
- func (q *Quirk) CreateMatcher() string
- func (q *Quirk) CreateSql() string
- func (q *Quirk) Exec(r ...any) error
- func (q *Quirk) ExecCtx(ctx context.Context, r ...any) error
- func (q *Quirk) If(condition bool, query string, arg ...Map) *Quirk
- func (q *Quirk) MustExec(r ...any)
- func (q *Quirk) MustExecCtx(ctx context.Context, r ...any)
- func (q *Quirk) Q(query string, arg ...Map) *Quirk
- func (q *Quirk) Subscribe(s subscription)
- func (q *Quirk) WhereExists() bool
- type Safe
Constants ¶
View Source
const ( Id = "id" CreatedAt = "created_at" UpdatedAt = "updated_at" Vectors = "vectors" )
View Source
const ( Default = "DEFAULT" CurrentTimestamp = "CURRENT_TIMESTAMP" )
View Source
const ( Postgres = "postgres" Mysql = "mysql" )
View Source
const ( ParamPrefix = "@" Placeholder = "?" )
View Source
const (
DefaultTimout = 30 * time.Second
)
Variables ¶
View Source
var (
ErrorMismatchArgs = errors.New("placeholders and args count mismatch")
)
Functions ¶
func CreateTableStructure ¶
func CreateTsQuery ¶
func CreateTsVector ¶
func CreateUpdate ¶
func MapToTsVectorsValue ¶
func RemoveAccents ¶
Types ¶
type Config ¶
type Config interface{}
func WithCertPath ¶
func WithDbname ¶
func WithDriver ¶
func WithPassword ¶
func WithPostgres ¶
func WithPostgres() Config
func WithSslAllow ¶
func WithSslAllow() Config
func WithSslDisable ¶
func WithSslDisable() Config
func WithSslPrefer ¶
func WithSslPrefer() Config
func WithSslRequire ¶
func WithSslRequire() Config
func WithSslVerifyCa ¶
func WithSslVerifyCa() Config
func WithSslVerifyFull ¶
func WithSslVerifyFull() Config
func WithTimeout ¶ added in v0.2.2
type DB ¶
func MustConnect ¶
func (*DB) DriverName ¶
func (*DB) MustCommit ¶
func (d *DB) MustCommit()
func (*DB) MustRollback ¶
func (d *DB) MustRollback()
type Field ¶
func MergeFields ¶
type Jsonb ¶
func MapToJsonb ¶
type Quirk ¶
type Quirk struct { *DB // contains filtered or unexported fields }
func (*Quirk) CreateMatcher ¶
func (*Quirk) MustExecCtx ¶ added in v0.2.2
func (*Quirk) WhereExists ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.