schema

package
v0.18.0-alpha.26 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2022 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

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

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