Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Check ¶ added in v0.3.0
type Check struct { Name string `spec:",name"` Expr string `spec:"expr"` schemahcl.DefaultExtension }
Check holds a specification for a check constraint on a table.
type Column ¶
type Column struct { Name string `spec:",name"` Null bool `spec:"null"` Type *schemahcl.Type `spec:"type"` Default cty.Value `spec:"default"` schemahcl.DefaultExtension }
Column holds a specification for a column in an SQL table.
type ForeignKey ¶
type ForeignKey struct { Symbol string `spec:",name"` Columns []*schemahcl.Ref `spec:"columns"` RefColumns []*schemahcl.Ref `spec:"ref_columns"` OnUpdate *schemahcl.Ref `spec:"on_update"` OnDelete *schemahcl.Ref `spec:"on_delete"` schemahcl.DefaultExtension }
ForeignKey holds a specification for the Foreign key of a table.
type Func ¶ added in v0.15.0
type Func struct { Name string `spec:",name"` Qualifier string `spec:",qualifier"` Schema *schemahcl.Ref `spec:"schema"` Args []*FuncArg `spec:"arg"` Lang cty.Value `spec:"lang"` // The definition and the return type are appended as additional // attribute by the spec creator to marshal it after the arguments. schemahcl.DefaultExtension }
Func holds the specification for a function.
func (*Func) Label ¶ added in v0.15.0
Label returns the defaults label used for the function resource.
func (*Func) QualifierLabel ¶ added in v0.15.0
QualifierLabel returns the qualifier label used for the function resource, if any.
func (*Func) SetQualifier ¶ added in v0.15.0
SetQualifier sets the qualifier label used for the function resource.
type FuncArg ¶ added in v0.15.0
type FuncArg struct { Name string `spec:",name"` Type *schemahcl.Type `spec:"type"` Default cty.Value `spec:"default"` // Optional attributes such as mode are added by the driver, // as their definition can be either a string or an enum (ref). schemahcl.DefaultExtension }
FuncArg holds the specification for a function argument.
type Index ¶
type Index struct { Name string `spec:",name"` Unique bool `spec:"unique,omitempty"` Parts []*IndexPart `spec:"on"` Columns []*schemahcl.Ref `spec:"columns"` schemahcl.DefaultExtension }
Index holds a specification for the index key of a table.
type IndexPart ¶ added in v0.3.2
type IndexPart struct { Desc bool `spec:"desc,omitempty"` Column *schemahcl.Ref `spec:"column"` Expr string `spec:"expr,omitempty"` schemahcl.DefaultExtension }
IndexPart holds a specification for the index key part.
type PrimaryKey ¶
type PrimaryKey struct { Columns []*schemahcl.Ref `spec:"columns"` schemahcl.DefaultExtension }
PrimaryKey holds a specification for the primary key of a table.
type Schema ¶
type Schema struct { Name string `spec:"name,name"` schemahcl.DefaultExtension }
Schema holds a specification for a Schema.
type Table ¶
type Table struct { Name string `spec:",name"` Qualifier string `spec:",qualifier"` Schema *schemahcl.Ref `spec:"schema"` Columns []*Column `spec:"column"` PrimaryKey *PrimaryKey `spec:"primary_key"` ForeignKeys []*ForeignKey `spec:"foreign_key"` Indexes []*Index `spec:"index"` Checks []*Check `spec:"check"` schemahcl.DefaultExtension }
Table holds a specification for an SQL table.
func (*Table) Label ¶ added in v0.13.2
Label returns the defaults label used for the table resource.
func (*Table) QualifierLabel ¶ added in v0.13.2
QualifierLabel returns the qualifier label used for the table resource, if any.
func (*Table) SetQualifier ¶ added in v0.13.2
SetQualifier sets the qualifier label used for the table resource.
type View ¶ added in v0.12.1
type View struct { Name string `spec:",name"` Qualifier string `spec:",qualifier"` Schema *schemahcl.Ref `spec:"schema"` Columns []*Column `spec:"column"` // Indexes on (materialized) views are supported // by some databases, like PostgreSQL. Indexes []*Index `spec:"index"` // The definition is appended as additional attribute // by the spec creator to marshal it after the columns. schemahcl.DefaultExtension }
View holds a specification for an SQL view.
func (*View) QualifierLabel ¶ added in v0.13.2
QualifierLabel returns the qualifier label used for the view resource, if any.
func (*View) SetQualifier ¶ added in v0.13.2
SetQualifier sets the qualifier label used for the view resource.