sqlspec

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2021 License: Apache-2.0 Imports: 2 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Column

type Column struct {
	Name     string                   `spec:",name"`
	Null     bool                     `spec:"null" override:"null"`
	TypeName string                   `spec:"type" override:"type"`
	Default  *schemaspec.LiteralValue `spec:"default" override:"default"`
	schemaspec.DefaultExtension
}

Column holds a specification for a column in an SQL table.

type ForeignKey

type ForeignKey struct {
	Symbol     string                 `spec:",name"`
	Columns    []*schemaspec.Ref      `spec:"columns"`
	RefColumns []*schemaspec.Ref      `spec:"ref_columns"`
	OnUpdate   schema.ReferenceOption `spec:"on_update"`
	OnDelete   schema.ReferenceOption `spec:"on_delete"`
	schemaspec.DefaultExtension
}

ForeignKey holds a specification for the Foreign key of a table.

type Index

type Index struct {
	Name    string            `spec:",name"`
	Unique  bool              `spec:"unique"`
	Columns []*schemaspec.Ref `spec:"columns"`
	schemaspec.DefaultExtension
}

Index holds a specification for the index key of a table.

type PrimaryKey

type PrimaryKey struct {
	Columns []*schemaspec.Ref `spec:"columns"`
	schemaspec.DefaultExtension
}

PrimaryKey holds a specification for the primary key of a table.

type Schema

type Schema struct {
	Name string `spec:",name"`
	schemaspec.DefaultExtension
}

Schema holds a specification for a Schema.

type Table

type Table struct {
	Name        string        `spec:",name"`
	SchemaName  string        `spec:"schema"`
	Columns     []*Column     `spec:"column"`
	PrimaryKey  *PrimaryKey   `spec:"primary_key"`
	ForeignKeys []*ForeignKey `spec:"foreign_key"`
	Indexes     []*Index      `spec:"index"`
	schemaspec.DefaultExtension
}

Table holds a specification for an SQL table.

type Type

type Type string

Type represents a database agnostic column type.

const (
	TypeInt     Type = "int"
	TypeInt8    Type = "int8"
	TypeInt16   Type = "int16"
	TypeInt64   Type = "int64"
	TypeUint    Type = "uint"
	TypeUint8   Type = "uint8"
	TypeUint16  Type = "uint16"
	TypeUint64  Type = "uint64"
	TypeString  Type = "string"
	TypeBinary  Type = "binary"
	TypeEnum    Type = "enum"
	TypeBoolean Type = "boolean"
	TypeDecimal Type = "decimal"
	TypeFloat   Type = "float"
	TypeTime    Type = "time"
)

Type<X> are Types that represent database agnostic column types to be used in Atlas DDL documents.

Jump to

Keyboard shortcuts

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