querybuilder

package
v0.4.38 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildInsertQuery

func BuildInsertQuery(
	driver, table string,
	columns []string,
	values [][]any,
	onConflictDoNothing *bool,
) (string, error)

func BuildSelectJoinQuery

func BuildSelectJoinQuery(
	driver, table string,
	columns []string,
	joins []*sqlJoin,
	whereClauses []string,
) (string, error)

func BuildSelectLimitQuery added in v0.4.31

func BuildSelectLimitQuery(
	driver, table string,
	limit uint,
) (string, error)

func BuildSelectQuery

func BuildSelectQuery(
	driver, table string,
	columns []string,
	whereClause *string,
) (string, error)

func BuildSelectQueryMap

func BuildSelectQueryMap(
	driver string,
	tableDependencies map[string][]*sqlmanager_shared.ForeignConstraint,
	runConfigs []*tabledependency.RunConfig,
	subsetByForeignKeyConstraints bool,
	groupedColumnInfo map[string]map[string]*sqlmanager_shared.ColumnInfo,
) (map[string]map[tabledependency.RunType]string, error)

returns map of schema.table -> select query

func BuildSelectRecursiveQuery

func BuildSelectRecursiveQuery(
	driver, table string,
	columns []string,
	columnInfoMap map[string]*sqlmanager_shared.ColumnInfo,
	dependencies []*selfReferencingCircularDependency,
	joins []*sqlJoin,
	whereClauses []string,
) (string, error)

func BuildTruncateQuery

func BuildTruncateQuery(
	driver, table string,
) (string, error)

func BuildUpdateQuery

func BuildUpdateQuery(
	driver, table string,
	insertColumns []string,
	whereColumns []string,
	columnValueMap map[string]any,
) (string, error)

Types

type SubsetColumnConstraint

type SubsetColumnConstraint struct {
	Columns     []string
	NotNullable []bool
	ForeignKey  *SubsetReferenceKey
}

type SubsetReferenceKey

type SubsetReferenceKey struct {
	Table         string
	Columns       []string
	OriginalTable *string
}

Jump to

Keyboard shortcuts

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