models

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2021 License: MIT Imports: 7 Imported by: 6

Documentation

Overview

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'xodb'.

Package models contains the types for schema 'xodb'.

Package models contains the types for schema 'xodb'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Package models contains the types for schema ”.

Package models contains the types for schema ”.

Package models contains the types for schema 'public'.

Package models contains the types for schema 'public'.

Index

Constants

This section is empty.

Variables

View Source
var XOLog = func(string, ...interface{}) {}

XOLog provides the log func used by generated queries.

Functions

This section is empty.

Types

type Column

type Column struct {
	FieldOrdinal        int    // field_ordinal
	ColumnName          string // column_name
	DataType            string // data_type
	RealDataType        string
	Extra               string
	IsEnum              bool
	NotNull             bool           // not_null
	DefaultValue        sql.NullString // default_value
	IsPrimaryKey        bool           // is_primary_key
	IsGenerated         bool
	IsVirtualFromConfig bool
	IsIncludeInType     bool
	IsIncludeInCreate   bool
	IsIncludeInUpdate   bool
	IsIncludeInFilter   bool
	DisableForCreate    bool
}

Column represents column info.

func MsTableColumns

func MsTableColumns(db XODB, schema string, table string) ([]*Column, error)

MsTableColumns runs a custom query, returning results as Column.

func MyTableColumns

func MyTableColumns(db XODB, schema string, table string) ([]*Column, error)

MyTableColumns runs a custom query, returning results as Column.

func OrTableColumns

func OrTableColumns(db XODB, schema string, table string) ([]*Column, error)

OrTableColumns runs a custom query, returning results as Column.

func PgTableColumns

func PgTableColumns(db XODB, schema string, table string, sys bool) ([]*Column, error)

PgTableColumns runs a custom query, returning results as Column.

func (*Column) GetMysqlDefaultStr

func (c *Column) GetMysqlDefaultStr() string

type Enum

type Enum struct {
	EnumName  string // enum_name
	TableName string // table_name
}

Enum represents a enum.

func MyEnums

func MyEnums(db XODB, schema string) ([]*Enum, error)

MyEnums runs a custom query, returning results as Enum.

func PgEnums

func PgEnums(db XODB, schema string) ([]*Enum, error)

PgEnums runs a custom query, returning results as Enum.

type EnumValue

type EnumValue struct {
	EnumValue  string // enum_value
	ConstValue int    // const_value
}

EnumValue represents a enum value.

func PgEnumValues

func PgEnumValues(db XODB, schema string, tableName string, enum string) ([]*EnumValue, error)

PgEnumValues runs a custom query, returning results as EnumValue.

type ForeignKey

type ForeignKey struct {
	ForeignKeyName string // foreign_key_name
	ColumnName     string // column_name
	RefIndexName   string // ref_index_name
	RefTableName   string // ref_table_name
	RefColumnName  string // ref_column_name
	KeyID          int    // key_id
	SeqNo          int    // seq_no
	OnUpdate       string // on_update
	OnDelete       string // on_delete
	Match          string // match
}

ForeignKey represents a foreign key.

func MsTableForeignKeys

func MsTableForeignKeys(db XODB, schema string, table string) ([]*ForeignKey, error)

MsTableForeignKeys runs a custom query, returning results as ForeignKey.

func MyTableForeignKeys

func MyTableForeignKeys(db XODB, schema string, table string) ([]*ForeignKey, error)

MyTableForeignKeys runs a custom query, returning results as ForeignKey.

func OrTableForeignKeys

func OrTableForeignKeys(db XODB, schema string, table string) ([]*ForeignKey, error)

OrTableForeignKeys runs a custom query, returning results as ForeignKey.

func PgTableForeignKeys

func PgTableForeignKeys(db XODB, schema string, table string) ([]*ForeignKey, error)

PgTableForeignKeys runs a custom query, returning results as ForeignKey.

func SqTableForeignKeys

func SqTableForeignKeys(db XODB, table string) ([]*ForeignKey, error)

SqTableForeignKeys runs a custom query, returning results as ForeignKey.

type Index

type Index struct {
	IndexName string // index_name
	IsUnique  bool   // is_unique
	IsPrimary bool   // is_primary
	SeqNo     int    // seq_no
	Origin    string // origin
	IsPartial bool   // is_partial
}

Index represents an index.

func MsTableIndexes

func MsTableIndexes(db XODB, schema string, table string) ([]*Index, error)

MsTableIndexes runs a custom query, returning results as Index.

func MyTableIndexes

func MyTableIndexes(db XODB, schema string, table string) ([]*Index, error)

MyTableIndexes runs a custom query, returning results as Index.

func OrTableIndexes

func OrTableIndexes(db XODB, schema string, table string) ([]*Index, error)

OrTableIndexes runs a custom query, returning results as Index.

func PgTableIndexes

func PgTableIndexes(db XODB, schema string, table string) ([]*Index, error)

PgTableIndexes runs a custom query, returning results as Index.

func SqTableIndexes

func SqTableIndexes(db XODB, table string) ([]*Index, error)

SqTableIndexes runs a custom query, returning results as Index.

type IndexColumn

type IndexColumn struct {
	SeqNo      int    // seq_no
	Cid        int    // cid
	ColumnName string // column_name
}

IndexColumn represents index column info.

func MsIndexColumns

func MsIndexColumns(db XODB, schema string, table string, index string) ([]*IndexColumn, error)

MsIndexColumns runs a custom query, returning results as IndexColumn.

func MyIndexColumns

func MyIndexColumns(db XODB, schema string, table string, index string) ([]*IndexColumn, error)

MyIndexColumns runs a custom query, returning results as IndexColumn.

func OrIndexColumns

func OrIndexColumns(db XODB, schema string, table string, index string) ([]*IndexColumn, error)

OrIndexColumns runs a custom query, returning results as IndexColumn.

func PgIndexColumns

func PgIndexColumns(db XODB, schema string, index string) ([]*IndexColumn, error)

PgIndexColumns runs a custom query, returning results as IndexColumn.

func SqIndexColumns

func SqIndexColumns(db XODB, index string) ([]*IndexColumn, error)

SqIndexColumns runs a custom query, returning results as IndexColumn.

type MsIdentity

type MsIdentity struct {
	TableName string // table_name
}

MsIdentity represents a row from '[custom ms_identity]'.

func MsIdentities

func MsIdentities(db XODB, schema string) ([]*MsIdentity, error)

MsIdentities runs a custom query, returning results as MsIdentity.

type MyAutoIncrement

type MyAutoIncrement struct {
	TableName string // table_name
}

MyAutoIncrement represents a row from '[custom my_auto_increment]'.

func MyAutoIncrements

func MyAutoIncrements(db XODB, schema string) ([]*MyAutoIncrement, error)

MyAutoIncrements runs a custom query, returning results as MyAutoIncrement.

type MyEnumValue

type MyEnumValue struct {
	EnumValues string // enum_values
}

MyEnumValue represents a row from '[custom my_enum_value]'.

func MyEnumValues

func MyEnumValues(db XODB, schema string, tableName string, enum string) (*MyEnumValue, error)

MyEnumValues runs a custom query, returning results as MyEnumValue.

type PgColOrder

type PgColOrder struct {
	Ord string // ord
}

PgColOrder represents index column order.

func PgGetColOrder

func PgGetColOrder(db XODB, schema string, index string) (*PgColOrder, error)

PgGetColOrder runs a custom query, returning results as PgColOrder.

type Proc

type Proc struct {
	ProcName   string // proc_name
	ReturnType string // return_type
}

Proc represents a stored procedure.

func MyProcs

func MyProcs(db XODB, schema string) ([]*Proc, error)

MyProcs runs a custom query, returning results as Proc.

func PgProcs

func PgProcs(db XODB, schema string) ([]*Proc, error)

PgProcs runs a custom query, returning results as Proc.

type ProcParam

type ProcParam struct {
	ParamType string // param_type
}

ProcParam represents a stored procedure param.

func MyProcParams

func MyProcParams(db XODB, schema string, proc string) ([]*ProcParam, error)

MyProcParams runs a custom query, returning results as ProcParam.

func PgProcParams

func PgProcParams(db XODB, schema string, proc string) ([]*ProcParam, error)

PgProcParams runs a custom query, returning results as ProcParam.

type ScannerValuer

type ScannerValuer interface {
	sql.Scanner
	driver.Valuer
}

ScannerValuer is the common interface for types that implement both the database/sql.Scanner and sql/driver.Valuer interfaces.

type Sequence

type Sequence struct {
	TableName string // table_name
}

Sequence represents a row from '[custom sequence]'.

func PgSequences

func PgSequences(db XODB, schema string) ([]*Sequence, error)

PgSequences runs a custom query, returning results as Sequence.

type Slice

type Slice []ScannerValuer

Slice is a slice of ScannerValuers.

type SqAutoIncrement

type SqAutoIncrement struct {
	TableName string // table_name
	SQL       string // sql
}

SqAutoIncrement represents a row from '[custom sq_auto_increment]'.

func SqAutoIncrements

func SqAutoIncrements(db XODB) ([]*SqAutoIncrement, error)

SqAutoIncrements runs a custom query, returning results as SqAutoIncrement.

type SqColumn

type SqColumn struct {
	FieldOrdinal int            // field_ordinal
	ColumnName   string         // column_name
	DataType     string         // data_type
	NotNull      bool           // not_null
	DefaultValue sql.NullString // default_value
	PkColIndex   int            // pk_col_index
}

SqColumn represents a row from '[custom sq_column]'.

func SqTableColumns

func SqTableColumns(db XODB, table string) ([]*SqColumn, error)

SqTableColumns runs a custom query, returning results as SqColumn.

type StringSlice

type StringSlice []string

StringSlice is a slice of strings.

func (*StringSlice) Scan

func (ss *StringSlice) Scan(src interface{}) error

Scan satisfies the sql.Scanner interface for StringSlice.

func (StringSlice) Value

func (ss StringSlice) Value() (driver.Value, error)

Value satisfies the driver.Valuer interface for StringSlice.

type Table

type Table struct {
	Type      string // type
	TableName string // table_name
	ManualPk  bool   // manual_pk
}

Table represents table info.

func MsTables

func MsTables(db XODB, schema string, relkind string) ([]*Table, error)

MsTables runs a custom query, returning results as Table.

func MyTables

func MyTables(db XODB, schema string, relkind string) ([]*Table, error)

MyTables runs a custom query, returning results as Table.

func OrTables

func OrTables(db XODB, schema string, relkind string) ([]*Table, error)

OrTables runs a custom query, returning results as Table.

func PgTables

func PgTables(db XODB, schema string, relkind string) ([]*Table, error)

PgTables runs a custom query, returning results as Table.

func SqTables

func SqTables(db XODB, relkind string) ([]*Table, error)

SqTables runs a custom query, returning results as Table.

type XODB

type XODB interface {
	Exec(string, ...interface{}) (sql.Result, error)
	Query(string, ...interface{}) (*sql.Rows, error)
	QueryRow(string, ...interface{}) *sql.Row
}

XODB is the common interface for database operations that can be used with types from schema 'public'.

This should work with database/sql.DB and database/sql.Tx.

Jump to

Keyboard shortcuts

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