sqlab

package module
v0.0.0-...-49f2dd1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 27, 2021 License: MIT Imports: 4 Imported by: 0

README

sqlab

The project waiting for planning, some SQL tool functions are temporarily deposited.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mysql

type Mysql struct {
	Sql
}

Mysql mysql tools

func (Mysql) UpsertBuilder

func (m Mysql) UpsertBuilder(
	tableName string, fields []string,
) func(valueGroups ...[]interface{}) (sql string, values []interface{}, err error)

UpsertBuilder build INSERT INTO ... ON DUPLICATE KEY UPDATE ...

type Sql

type Sql struct {
}

Sql sql common tools

func (Sql) In

func (s Sql) In(query string, args ...interface{}) (string, []interface{}, error)

In expands slice values in args, returning the modified query string and a new arg list that can be executed by a database. The `query` should use the `?` bindVar. The return value uses the `?` bindVar.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL