schema

package
v0.10.0-beta.3 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2021 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsSchemaNameValid

func IsSchemaNameValid(name string) (bool, string)

IsSchemaNameValid :: verifies that the given string is a valid pgsql schema name

Types

type ColumnSchema

type ColumnSchema struct {
	ID          string
	Name        string
	NotNull     bool
	Type        string
	Default     string
	Description string
}

ColumnSchema contains the details of a single column in a table

type Metadata

type Metadata struct {
	// map {schemaname, {map {tablename -> tableschema}}
	Schemas map[string]map[string]TableSchema
	// the search path that is set in the backend
	SearchPath []string
	// the name of the temporary schema
	TemporarySchemaName string
}

Metadata is a struct to represent the schema of the database

func NewMetadata added in v0.5.0

func NewMetadata() *Metadata

func (*Metadata) GetSchemas

func (m *Metadata) GetSchemas() []string

GetSchemas returns all foreign schema names

func (*Metadata) GetTablesInSchema

func (m *Metadata) GetTablesInSchema(schemaName string) []string

GetTablesInSchema :: returns all foreign tables in a given foreign schema

type SQLFunc added in v0.1.2

type SQLFunc struct {
	Name     string
	Params   map[string]string
	Returns  string
	Body     string
	Language string
}

SQLFunc :: struct for an sqlFunc

type TableSchema

type TableSchema struct {
	// map {columnName -> columnschema}
	Columns     map[string]ColumnSchema
	Name        string
	Schema      string
	Description string
}

TableSchema contains the details of a single table in the schema

Jump to

Keyboard shortcuts

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