dialect

package
v1.0.156 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB2Dialect

type DB2Dialect struct {
	Dialect
}

func (*DB2Dialect) GetCountSql

func (self *DB2Dialect) GetCountSql(sql string) (string, error)

func (*DB2Dialect) GetLimitSql

func (self *DB2Dialect) GetLimitSql(sql string) (string, error)

func (*DB2Dialect) Support

func (self *DB2Dialect) Support() (bool, error)

type Derby

type Derby struct {
	Dialect
}

func (*Derby) GetCountSql

func (self *Derby) GetCountSql(sql string) (string, error)

func (*Derby) GetLimitSql

func (self *Derby) GetLimitSql(sql string) (string, error)

func (*Derby) Support

func (self *Derby) Support() (bool, error)

type Dialect

type Dialect struct {
	PageNo             int64   // 页码索引
	PageSize           int64   // 每页条数
	PageTotal          int64   // 总条数
	PageCount          int64   // 总页数
	Spilled            bool    // 分页类型
	IsOffset           bool    // 是否按下标分页
	IsPage             bool    // 是否分页
	IsFastPage         bool    // 是否快速分页
	FastPageKey        string  // 快速分页索引
	FastPageSort       int     // 快速分页正反序
	FastPageParam      []int64 // 快速分页下标值
	FastPageSortParam  int     // 快速分页正反序值
	FastPageSortCountQ bool    // 是否执行count
}

方言分页对象

func (*Dialect) GetCountSql

func (self *Dialect) GetCountSql(sql string) (string, error)

func (*Dialect) GetLimitSql

func (self *Dialect) GetLimitSql(sql string) (string, error)

func (*Dialect) GetResult added in v1.0.49

func (self *Dialect) GetResult() PageResult

func (*Dialect) Support

func (self *Dialect) Support() (bool, error)

type HSQLDialect

type HSQLDialect struct {
	Dialect
}

func (*HSQLDialect) GetCountSql

func (self *HSQLDialect) GetCountSql(sql string) (string, error)

func (*HSQLDialect) GetLimitSql

func (self *HSQLDialect) GetLimitSql(sql string) (string, error)

func (*HSQLDialect) Support

func (self *HSQLDialect) Support() (bool, error)

type IDialect

type IDialect interface {
	// 是否支持分页
	Support() (bool, error)
	// 获取统计语句
	GetCountSql(sql string) (string, error)
	// 获取分页语句
	GetLimitSql(sql string) (string, error)
	// 分页结果
	GetResult() PageResult
}

方言分页接口

type MysqlDialect

type MysqlDialect struct {
	Dialect
}

func (*MysqlDialect) GetCountSql

func (self *MysqlDialect) GetCountSql(sql string) (string, error)

func (*MysqlDialect) GetLimitSql

func (self *MysqlDialect) GetLimitSql(sql string) (string, error)

func (*MysqlDialect) Support

func (self *MysqlDialect) Support() (bool, error)

type OracleDialect

type OracleDialect struct {
	Dialect
}

func (*OracleDialect) GetCountSql

func (self *OracleDialect) GetCountSql(sql string) (string, error)

func (*OracleDialect) GetLimitSql

func (self *OracleDialect) GetLimitSql(sql string) (string, error)

func (*OracleDialect) Support

func (self *OracleDialect) Support() (bool, error)

type PageResult added in v1.0.49

type PageResult struct {
	PageNo    int64 `json:"pageNo"`    // 当前索引
	PageSize  int64 `json:"pageSize"`  // 分页截取数量
	PageTotal int64 `json:"pageTotal"` // 总数据量
	PageCount int64 `json:"pageCount"` // 总页数 pageTotal/pageSize
}

type PostgreSQL

type PostgreSQL struct {
	Dialect
}

func (*PostgreSQL) GetCountSql

func (self *PostgreSQL) GetCountSql(sql string) (string, error)

func (*PostgreSQL) GetLimitSql

func (self *PostgreSQL) GetLimitSql(sql string) (string, error)

func (*PostgreSQL) Support

func (self *PostgreSQL) Support() (bool, error)

type SQLServer

type SQLServer struct {
	Dialect
}

func (*SQLServer) GetCountSql

func (self *SQLServer) GetCountSql(sql string) (string, error)

func (*SQLServer) GetLimitSql

func (self *SQLServer) GetLimitSql(sql string) (string, error)

func (*SQLServer) Support

func (self *SQLServer) Support() (bool, error)

type SQLServer2005

type SQLServer2005 struct {
	Dialect
}

func (*SQLServer2005) GetCountSql

func (self *SQLServer2005) GetCountSql(sql string) (string, error)

func (*SQLServer2005) GetLimitSql

func (self *SQLServer2005) GetLimitSql(sql string) (string, error)

func (*SQLServer2005) Support

func (self *SQLServer2005) Support() (bool, error)

type Sybase

type Sybase struct {
	Dialect
}

func (*Sybase) GetCountSql

func (self *Sybase) GetCountSql(sql string) (string, error)

func (*Sybase) GetLimitSql

func (self *Sybase) GetLimitSql(sql string) (string, error)

func (*Sybase) Support

func (self *Sybase) Support() (bool, error)

Jump to

Keyboard shortcuts

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