statements

package
v1.0.10 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FieldDatabaseName define database name
	FieldDatabaseName = "datname"

	// FieldSchemaName define schema name
	FieldSchemaName = "schema_name"

	// FieldCountDatabaseName count by database name
	FieldCountDatabaseName = "COUNT(datname)"

	// FieldCountSchemaName count by schema name
	FieldCountSchemaName = "COUNT(schema_name)"

	// DatabasesSelect clause
	DatabasesSelect = `
SELECT
	%s
FROM
	pg_database`

	// DatabasesWhere clause
	DatabasesWhere = `
WHERE
	NOT datistemplate`
	// DatabasesOrderBy clause
	DatabasesOrderBy = `
ORDER BY
	%s ASC`

	// SchemasSelect clause
	SchemasSelect = `
SELECT
	%s
FROM
	information_schema.schemata`

	// SchemasGroupBy clause
	SchemasGroupBy = `
GROUP BY
	%s`

	// SchemasOrderBy clause
	SchemasOrderBy = `
ORDER BY
	%s ASC`

	// TablesSelect clause
	TablesSelect = `` /* 420-byte string literal not displayed */

	// TablesWhere clause
	TablesWhere = `` /* 181-byte string literal not displayed */

	// TablesOrderBy clause
	TablesOrderBy = `
ORDER BY 1, 2`
	// Tables default query
	Tables = TablesSelect + TablesWhere + TablesOrderBy

	// SchemaTablesSelect clause
	SchemaTablesSelect = `` /* 194-byte string literal not displayed */

	// SchemaTablesWhere clause
	SchemaTablesWhere = `
WHERE
	sc.catalog_name = $1 AND
	t.schemaname = $2`

	// SchemaTablesOrderBy clause
	SchemaTablesOrderBy = `
ORDER BY
	t.tablename ASC`

	// SchemaTables default query
	SchemaTables = SchemaTablesSelect + SchemaTablesWhere + SchemaTablesOrderBy

	// SelectInTable default query
	SelectInTable = `
SELECT
	*
FROM`

	// InsertQuery query
	InsertQuery = `INSERT INTO "%s"."%s"."%s"(%s) VALUES%s`

	// DeleteQuery query
	DeleteQuery = `DELETE FROM "%s"."%s"."%s"`

	// UpdateQuery query
	UpdateQuery = `UPDATE "%s"."%s"."%s" SET %s`

	// GroupBy query
	GroupBy = `GROUP BY %s`

	// Having query
	Having = `HAVING %s %s %s`
)

Variables

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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