dialect

package
v3.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package dialect 提供了部分数据库对 orm.Dialect 接口的实现

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Mariadb

func Mariadb(driverName string) core.Dialect

Mariadb 返回一个适配 mysql 的 Dialect 接口

meta 属性可参考 mysql,大部分内容增多与 Mysql 相同。

func Mysql

func Mysql(driverName string) core.Dialect

Mysql 返回一个适配 mysql 的 Dialect 接口

支持以下 meta 属性

charset 字符集,语法为: charset(utf-8)
engine 使用的引擎,语法为: engine(innodb)

func MysqlLimitSQL

func MysqlLimitSQL(limit interface{}, offset ...interface{}) (string, []interface{})

MysqlLimitSQL mysql 系列数据库分页语法的实现

支持以下数据库:MySQL, H2, HSQLDB, Postgres, SQLite3

func OracleLimitSQL

func OracleLimitSQL(limit interface{}, offset ...interface{}) (string, []interface{})

OracleLimitSQL oracle 系列数据库分页语法的实现

支持以下数据库:Derby, SQL Server 2012, Oracle 12c, the SQL 2008 standard

func Postgres

func Postgres(driverName string) core.Dialect

Postgres 返回一个适配 postgresql 的 Dialect 接口

func PrepareNamedArgs

func PrepareNamedArgs(query string) (string, map[string]int, error)

PrepareNamedArgs 对命名参数进行预处理

返回符合 core.Dialect.Prepare 方法的数据。

func ReplaceNamedArgs

func ReplaceNamedArgs(query string, args []interface{}) string

ReplaceNamedArgs 替换 SQL 语句中的命名参数为标准的 ? 符号

func Sqlite3

func Sqlite3(driverName string) core.Dialect

Sqlite3 返回一个适配 sqlite3 的 Dialect 接口

Meta 可以接受以下参数:

rowid 可以是 rowid(false);rowid(true),rowid,其中只有 rowid(false) 等同于 without rowid

Types

This section is empty.

Jump to

Keyboard shortcuts

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