query

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

Builder 用于构建 Doris SQL 查询

func NewQueryBuilder

func NewQueryBuilder(table string, log *log.Helper) *Builder

NewQueryBuilder 创建一个新的 Builder 实例

func (*Builder) ArrayJoin

func (qb *Builder) ArrayJoin(expression string) *Builder

ArrayJoin 添加 ARRAY JOIN 子句

func (*Builder) Build

func (qb *Builder) Build() (string, []interface{})

Build 构建最终的 SQL 查询

func (*Builder) BuildWhereParam

func (qb *Builder) BuildWhereParam() (string, []interface{})

BuildWhereParam 构建 WHERE 子句和参数列表

func (*Builder) CacheResult

func (qb *Builder) CacheResult() *Builder

CacheResult 启用查询结果缓存

func (*Builder) Distinct

func (qb *Builder) Distinct() *Builder

Distinct 设置 DISTINCT 查询

func (*Builder) EnableDebug

func (qb *Builder) EnableDebug() *Builder

EnableDebug 启用调试模式

func (*Builder) Final

func (qb *Builder) Final() *Builder

Final 添加 FINAL 修饰符

func (*Builder) Format

func (qb *Builder) Format(format string) *Builder

Format 添加 FORMAT 子句

func (*Builder) GroupBy

func (qb *Builder) GroupBy(columns ...string) *Builder

GroupBy 设置分组条件

func (*Builder) Having

func (qb *Builder) Having(condition string, args ...interface{}) *Builder

Having 添加分组后的过滤条件并支持参数化

func (*Builder) Limit

func (qb *Builder) Limit(limit int) *Builder

Limit 设置查询结果的限制数量

func (*Builder) LimitBy

func (qb *Builder) LimitBy(limit int, columns ...string) *Builder

LimitBy 添加 LIMIT BY 子句

func (*Builder) Logger

func (qb *Builder) Logger() *log.Helper

func (*Builder) Offset

func (qb *Builder) Offset(offset int) *Builder

Offset 设置查询结果的偏移量

func (*Builder) OrderBy

func (qb *Builder) OrderBy(order string, desc bool) *Builder

OrderBy 设置排序条件

func (*Builder) PreWhere

func (qb *Builder) PreWhere(condition string, args ...interface{}) *Builder

PreWhere 添加 PREWHERE 子句

func (*Builder) Sample

func (qb *Builder) Sample(sampleRate float64) *Builder

Sample 添加 SAMPLE 子句

func (*Builder) Select

func (qb *Builder) Select(columns ...string) *Builder

Select 设置查询的列

func (*Builder) TableName

func (qb *Builder) TableName() string

TableName 返回查询的表名

func (*Builder) UseIndex

func (qb *Builder) UseIndex(index string) *Builder

UseIndex 设置索引提示

func (*Builder) Where

func (qb *Builder) Where(condition string, args ...interface{}) *Builder

Where 添加查询条件并支持参数化

func (*Builder) WithLogger

func (qb *Builder) WithLogger(l *log.Helper) *Builder

func (*Builder) WithTableName

func (qb *Builder) WithTableName(tableName string) *Builder

Jump to

Keyboard shortcuts

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