sqlc

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DBTX

type DBTX interface {
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	PrepareContext(context.Context, string) (*sql.Stmt, error)
	QueryContext(context.Context, string, ...interface{}) (*sql.Rows, error)
	QueryRowContext(context.Context, string, ...interface{}) *sql.Row
}

type GetTableRowSecurityParams

type GetTableRowSecurityParams struct {
	SchemaName string `json:"schema_name"`
	TableName  string `json:"table_name"`
}

type GetTypeDefinitionParams

type GetTypeDefinitionParams struct {
	TypeName   string `json:"type_name"`
	SchemaName string `json:"schema_name"`
}

type ListColumnsForTableParams

type ListColumnsForTableParams struct {
	SchemaName string `json:"schema_name"`
	TableName  string `json:"table_name"`
}

type ListColumnsForTableRow

type ListColumnsForTableRow struct {
	ColumnName           string `json:"column_name"`
	DataType             string `json:"data_type"`
	IsNullable           bool   `json:"is_nullable"`
	ColumnDefault        string `json:"column_default"`
	IsGenerated          bool   `json:"is_generated"`
	GenerationExpression string `json:"generation_expression"`
	IsIdentity           bool   `json:"is_identity"`
	IdentityGeneration   string `json:"identity_generation"`
	CollationName        string `json:"collation_name"`
	ColumnComment        string `json:"column_comment"`
}

type ListConstraintsForTableParams

type ListConstraintsForTableParams struct {
	SchemaName string `json:"schema_name"`
	TableName  string `json:"table_name"`
}

type ListConstraintsForTableRow

type ListConstraintsForTableRow struct {
	ConstraintName    string   `json:"constraint_name"`
	ConstraintType    string   `json:"constraint_type"`
	Columns           []string `json:"columns"`
	RefTable          string   `json:"ref_table"`
	RefColumns        []string `json:"ref_columns"`
	OnDelete          string   `json:"on_delete"`
	OnUpdate          string   `json:"on_update"`
	IsDeferrable      bool     `json:"is_deferrable"`
	InitiallyDeferred bool     `json:"initially_deferred"`
	CheckExpr         string   `json:"check_expr"`
}

type ListExtensionsRow

type ListExtensionsRow struct {
	Name        string       `json:"name"`
	Version     string       `json:"version"`
	Schema      string       `json:"schema"`
	Comment     string       `json:"comment"`
	Relocatable sql.NullBool `json:"relocatable"`
}

type ListFunctionsForSchemaRow

type ListFunctionsForSchemaRow struct {
	FunctionName string       `json:"function_name"`
	Signature    string       `json:"signature"`
	Language     string       `json:"language"`
	ReturnType   string       `json:"return_type"`
	Body         string       `json:"body"`
	Volatility   string       `json:"volatility"`
	IsStrict     sql.NullBool `json:"is_strict"`
	Security     string       `json:"security"`
	Comment      string       `json:"comment"`
}

type ListIndexesForTableParams

type ListIndexesForTableParams struct {
	SchemaName string `json:"schema_name"`
	TableName  string `json:"table_name"`
}

type ListIndexesForTableRow

type ListIndexesForTableRow struct {
	IndexName   string       `json:"index_name"`
	Columns     []string     `json:"columns"`
	IndexMethod string       `json:"index_method"`
	IsUnique    sql.NullBool `json:"is_unique"`
	IsPrimary   sql.NullBool `json:"is_primary"`
	WhereClause string       `json:"where_clause"`
	Definition  string       `json:"definition"`
}

type ListMaterializedViewsForSchemaRow

type ListMaterializedViewsForSchemaRow struct {
	MatviewName string       `json:"matview_name"`
	Definition  string       `json:"definition"`
	IsPopulated sql.NullBool `json:"is_populated"`
	Comment     string       `json:"comment"`
}

type ListPoliciesForTableParams

type ListPoliciesForTableParams struct {
	SchemaName string `json:"schema_name"`
	TableName  string `json:"table_name"`
}

type ListPoliciesForTableRow

type ListPoliciesForTableRow struct {
	PolicyName    string       `json:"policy_name"`
	Command       string       `json:"command"`
	Permissive    sql.NullBool `json:"permissive"`
	Roles         []string     `json:"roles"`
	UsingExpr     string       `json:"using_expr"`
	WithCheckExpr string       `json:"with_check_expr"`
}

type ListSequencesForSchemaRow

type ListSequencesForSchemaRow struct {
	SequenceName string       `json:"sequence_name"`
	DataType     string       `json:"data_type"`
	StartValue   int64        `json:"start_value"`
	Increment    int64        `json:"increment"`
	MinValue     int64        `json:"min_value"`
	MaxValue     int64        `json:"max_value"`
	CacheSize    int64        `json:"cache_size"`
	IsCycle      sql.NullBool `json:"is_cycle"`
	OwnedBy      string       `json:"owned_by"`
}

type ListSignatureConstraintsRow

type ListSignatureConstraintsRow struct {
	SchemaName     string `json:"schema_name"`
	TableName      string `json:"table_name"`
	ConstraintName string `json:"constraint_name"`
	Definition     string `json:"definition"`
}

type ListSignatureExtensionsRow

type ListSignatureExtensionsRow struct {
	Name    string `json:"name"`
	Version string `json:"version"`
}

type ListSignatureFunctionsRow

type ListSignatureFunctionsRow struct {
	SchemaName        string `json:"schema_name"`
	FunctionName      string `json:"function_name"`
	IdentityArguments string `json:"identity_arguments"`
	Definition        string `json:"definition"`
}

type ListSignatureIndexesRow

type ListSignatureIndexesRow struct {
	SchemaName string `json:"schema_name"`
	TableName  string `json:"table_name"`
	IndexName  string `json:"index_name"`
	Definition string `json:"definition"`
}

type ListSignaturePoliciesRow

type ListSignaturePoliciesRow struct {
	SchemaName string `json:"schema_name"`
	TableName  string `json:"table_name"`
	PolicyName string `json:"policy_name"`
	Command    string `json:"command"`
	Permissive bool   `json:"permissive"`
	UsingExpr  string `json:"using_expr"`
	CheckExpr  string `json:"check_expr"`
}

type ListSignatureTableColumnsRow

type ListSignatureTableColumnsRow struct {
	SchemaName  string `json:"schema_name"`
	TableName   string `json:"table_name"`
	Attnum      int32  `json:"attnum"`
	ColumnName  string `json:"column_name"`
	DataType    string `json:"data_type"`
	NotNull     bool   `json:"not_null"`
	DefaultExpr string `json:"default_expr"`
}

type ListSignatureTriggersRow

type ListSignatureTriggersRow struct {
	SchemaName  string `json:"schema_name"`
	TableName   string `json:"table_name"`
	TriggerName string `json:"trigger_name"`
	Definition  string `json:"definition"`
}

type ListSignatureViewsRow

type ListSignatureViewsRow struct {
	SchemaName string `json:"schema_name"`
	ViewName   string `json:"view_name"`
	RelKind    string `json:"rel_kind"`
	Definition string `json:"definition"`
}

type ListTablesForSchemaRow

type ListTablesForSchemaRow struct {
	TableName    string `json:"table_name"`
	TableComment string `json:"table_comment"`
}

type ListTriggersForTableParams

type ListTriggersForTableParams struct {
	SchemaName string `json:"schema_name"`
	TableName  string `json:"table_name"`
}

type ListTriggersForTableRow

type ListTriggersForTableRow struct {
	TriggerName  string   `json:"trigger_name"`
	FunctionName string   `json:"function_name"`
	Timing       string   `json:"timing"`
	Level        string   `json:"level"`
	Events       []string `json:"events"`
	Condition    string   `json:"condition"`
	IsEnabled    bool     `json:"is_enabled"`
}

type ListTypesForSchemaRow

type ListTypesForSchemaRow struct {
	TypeName     string   `json:"type_name"`
	TypeKind     string   `json:"type_kind"`
	EnumElements []string `json:"enum_elements"`
	Comment      string   `json:"comment"`
}

type ListViewsForSchemaRow

type ListViewsForSchemaRow struct {
	ViewName   string `json:"view_name"`
	Definition string `json:"definition"`
	Comment    string `json:"comment"`
}

type PgAm

type PgAm struct {
	Oid    sql.NullInt64  `json:"oid"`
	Amname sql.NullString `json:"amname"`
}

type PgAttrdef

type PgAttrdef struct {
	Adrelid sql.NullInt64  `json:"adrelid"`
	Adnum   sql.NullInt32  `json:"adnum"`
	Adbin   sql.NullString `json:"adbin"`
}

type PgAttribute

type PgAttribute struct {
	Attrelid     sql.NullInt64  `json:"attrelid"`
	Attnum       sql.NullInt32  `json:"attnum"`
	Attname      sql.NullString `json:"attname"`
	Atttypid     sql.NullInt64  `json:"atttypid"`
	Atttypmod    sql.NullInt32  `json:"atttypmod"`
	Attnotnull   sql.NullBool   `json:"attnotnull"`
	Attisdropped sql.NullBool   `json:"attisdropped"`
}

type PgClass

type PgClass struct {
	Oid            sql.NullInt64  `json:"oid"`
	Relname        sql.NullString `json:"relname"`
	Relnamespace   sql.NullInt64  `json:"relnamespace"`
	Relkind        sql.NullString `json:"relkind"`
	Relam          sql.NullInt64  `json:"relam"`
	Relrowsecurity sql.NullBool   `json:"relrowsecurity"`
}

type PgConstraint

type PgConstraint struct {
	Oid           sql.NullInt64  `json:"oid"`
	Conname       sql.NullString `json:"conname"`
	Connamespace  sql.NullInt64  `json:"connamespace"`
	Condeferrable sql.NullBool   `json:"condeferrable"`
	Condeferred   sql.NullBool   `json:"condeferred"`
	Conrelid      sql.NullInt64  `json:"conrelid"`
}

type PgDepend

type PgDepend struct {
	Objid       sql.NullInt64  `json:"objid"`
	Deptype     sql.NullString `json:"deptype"`
	Refobjid    sql.NullInt64  `json:"refobjid"`
	Refobjsubid sql.NullInt32  `json:"refobjsubid"`
}

type PgDescription

type PgDescription struct {
	Objoid      sql.NullInt64  `json:"objoid"`
	Objsubid    sql.NullInt32  `json:"objsubid"`
	Description sql.NullString `json:"description"`
}

type PgEnum

type PgEnum struct {
	Enumtypid     sql.NullInt64   `json:"enumtypid"`
	Enumlabel     sql.NullString  `json:"enumlabel"`
	Enumsortorder sql.NullFloat64 `json:"enumsortorder"`
}

type PgExtension

type PgExtension struct {
	Oid            sql.NullInt64  `json:"oid"`
	Extname        sql.NullString `json:"extname"`
	Extversion     sql.NullString `json:"extversion"`
	Extnamespace   sql.NullInt64  `json:"extnamespace"`
	Extrelocatable sql.NullBool   `json:"extrelocatable"`
}

type PgIndex

type PgIndex struct {
	Indrelid     sql.NullInt64  `json:"indrelid"`
	Indexrelid   sql.NullInt64  `json:"indexrelid"`
	Indkey       []int32        `json:"indkey"`
	Indisunique  sql.NullBool   `json:"indisunique"`
	Indisprimary sql.NullBool   `json:"indisprimary"`
	Indpred      sql.NullString `json:"indpred"`
}

type PgLanguage

type PgLanguage struct {
	Oid     sql.NullInt64  `json:"oid"`
	Lanname sql.NullString `json:"lanname"`
}

type PgMatview

type PgMatview struct {
	Schemaname  sql.NullString `json:"schemaname"`
	Matviewname sql.NullString `json:"matviewname"`
	Definition  sql.NullString `json:"definition"`
	Ispopulated sql.NullBool   `json:"ispopulated"`
}

type PgNamespace

type PgNamespace struct {
	Oid     sql.NullInt64  `json:"oid"`
	Nspname sql.NullString `json:"nspname"`
}

type PgPolicy

type PgPolicy struct {
	Polname       sql.NullString `json:"polname"`
	Polcmd        sql.NullString `json:"polcmd"`
	Polpermissive sql.NullBool   `json:"polpermissive"`
	Polroles      []int64        `json:"polroles"`
	Polqual       sql.NullString `json:"polqual"`
	Polwithcheck  sql.NullString `json:"polwithcheck"`
	Polrelid      sql.NullInt64  `json:"polrelid"`
}

type PgProc

type PgProc struct {
	Oid          sql.NullInt64  `json:"oid"`
	Proname      sql.NullString `json:"proname"`
	Pronamespace sql.NullInt64  `json:"pronamespace"`
	Prolang      sql.NullInt64  `json:"prolang"`
	Provolatile  sql.NullString `json:"provolatile"`
	Proisstrict  sql.NullBool   `json:"proisstrict"`
	Prosecdef    sql.NullBool   `json:"prosecdef"`
	Prokind      sql.NullString `json:"prokind"`
}

type PgRole

type PgRole struct {
	Oid     sql.NullInt64  `json:"oid"`
	Rolname sql.NullString `json:"rolname"`
}

type PgSequence

type PgSequence struct {
	Seqrelid     sql.NullInt64 `json:"seqrelid"`
	Seqtypid     sql.NullInt64 `json:"seqtypid"`
	Seqstart     sql.NullInt64 `json:"seqstart"`
	Seqincrement sql.NullInt64 `json:"seqincrement"`
	Seqmin       sql.NullInt64 `json:"seqmin"`
	Seqmax       sql.NullInt64 `json:"seqmax"`
	Seqcache     sql.NullInt64 `json:"seqcache"`
	Seqcycle     sql.NullBool  `json:"seqcycle"`
}

type PgTrigger

type PgTrigger struct {
	Oid          sql.NullInt64  `json:"oid"`
	Tgname       sql.NullString `json:"tgname"`
	Tgrelid      sql.NullInt64  `json:"tgrelid"`
	Tgfoid       sql.NullInt64  `json:"tgfoid"`
	Tgtype       sql.NullInt32  `json:"tgtype"`
	Tgqual       sql.NullString `json:"tgqual"`
	Tgenabled    sql.NullString `json:"tgenabled"`
	Tgisinternal sql.NullBool   `json:"tgisinternal"`
}

type PgType

type PgType struct {
	Oid          sql.NullInt64  `json:"oid"`
	Typname      sql.NullString `json:"typname"`
	Typnamespace sql.NullInt64  `json:"typnamespace"`
	Typtype      sql.NullString `json:"typtype"`
}

type Queries

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

func New

func New(db DBTX) *Queries

func (*Queries) GetPostgresVersion

func (q *Queries) GetPostgresVersion(ctx context.Context) (string, error)

func (*Queries) GetSearchPath

func (q *Queries) GetSearchPath(ctx context.Context) (string, error)

func (*Queries) GetTableRowSecurity

func (q *Queries) GetTableRowSecurity(ctx context.Context, arg GetTableRowSecurityParams) (bool, error)

func (*Queries) GetTypeDefinition

func (q *Queries) GetTypeDefinition(ctx context.Context, arg GetTypeDefinitionParams) (string, error)

func (*Queries) ListColumnsForTable

func (q *Queries) ListColumnsForTable(ctx context.Context, arg ListColumnsForTableParams) ([]ListColumnsForTableRow, error)

func (*Queries) ListConstraintsForTable

func (q *Queries) ListConstraintsForTable(ctx context.Context, arg ListConstraintsForTableParams) ([]ListConstraintsForTableRow, error)

func (*Queries) ListExtensions

func (q *Queries) ListExtensions(ctx context.Context) ([]ListExtensionsRow, error)

func (*Queries) ListFunctionsForSchema

func (q *Queries) ListFunctionsForSchema(ctx context.Context, schemaName string) ([]ListFunctionsForSchemaRow, error)

func (*Queries) ListIndexesForTable

func (q *Queries) ListIndexesForTable(ctx context.Context, arg ListIndexesForTableParams) ([]ListIndexesForTableRow, error)

func (*Queries) ListMaterializedViewsForSchema

func (q *Queries) ListMaterializedViewsForSchema(ctx context.Context, schemaName string) ([]ListMaterializedViewsForSchemaRow, error)

func (*Queries) ListPoliciesForTable

func (q *Queries) ListPoliciesForTable(ctx context.Context, arg ListPoliciesForTableParams) ([]ListPoliciesForTableRow, error)

func (*Queries) ListSequencesForSchema

func (q *Queries) ListSequencesForSchema(ctx context.Context, schemaName string) ([]ListSequencesForSchemaRow, error)

func (*Queries) ListSignatureConstraints

func (q *Queries) ListSignatureConstraints(ctx context.Context) ([]ListSignatureConstraintsRow, error)

func (*Queries) ListSignatureExtensions

func (q *Queries) ListSignatureExtensions(ctx context.Context) ([]ListSignatureExtensionsRow, error)

func (*Queries) ListSignatureFunctions

func (q *Queries) ListSignatureFunctions(ctx context.Context) ([]ListSignatureFunctionsRow, error)

func (*Queries) ListSignatureIndexes

func (q *Queries) ListSignatureIndexes(ctx context.Context) ([]ListSignatureIndexesRow, error)

func (*Queries) ListSignaturePolicies

func (q *Queries) ListSignaturePolicies(ctx context.Context) ([]ListSignaturePoliciesRow, error)

func (*Queries) ListSignatureTableColumns

func (q *Queries) ListSignatureTableColumns(ctx context.Context) ([]ListSignatureTableColumnsRow, error)

func (*Queries) ListSignatureTriggers

func (q *Queries) ListSignatureTriggers(ctx context.Context) ([]ListSignatureTriggersRow, error)

func (*Queries) ListSignatureViews

func (q *Queries) ListSignatureViews(ctx context.Context) ([]ListSignatureViewsRow, error)

func (*Queries) ListTablesForSchema

func (q *Queries) ListTablesForSchema(ctx context.Context, schemaName string) ([]ListTablesForSchemaRow, error)

func (*Queries) ListTriggersForTable

func (q *Queries) ListTriggersForTable(ctx context.Context, arg ListTriggersForTableParams) ([]ListTriggersForTableRow, error)

func (*Queries) ListTypesForSchema

func (q *Queries) ListTypesForSchema(ctx context.Context, schemaName string) ([]ListTypesForSchemaRow, error)

func (*Queries) ListUserSchemas

func (q *Queries) ListUserSchemas(ctx context.Context) ([]string, error)

func (*Queries) ListViewsForSchema

func (q *Queries) ListViewsForSchema(ctx context.Context, schemaName string) ([]ListViewsForSchemaRow, error)

func (*Queries) WithTx

func (q *Queries) WithTx(tx *sql.Tx) *Queries

Jump to

Keyboard shortcuts

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