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 '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 '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
- Variables
- func SayHello(db XODB, v0 string) (string, error)
- type Author
- type Book
- type BookType
- type Column
- func MsTableColumns(db XODB, schema string, table string) ([]*Column, error)
- func MyTableColumns(db XODB, schema string, table string) ([]*Column, error)
- func OrTableColumns(db XODB, schema string, table string) ([]*Column, error)
- func PgTableColumns(db XODB, schema string, table string, sys bool) ([]*Column, error)
- type CrAutoincrement
- type Enum
- type EnumValue
- type ForeignKey
- func MsTableForeignKeys(db XODB, schema string, table string) ([]*ForeignKey, error)
- func MyTableForeignKeys(db XODB, schema string, table string) ([]*ForeignKey, error)
- func OrTableForeignKeys(db XODB, schema string, table string) ([]*ForeignKey, error)
- func PgTableForeignKeys(db XODB, schema string, table string) ([]*ForeignKey, error)
- func SqTableForeignKeys(db XODB, table string) ([]*ForeignKey, error)
- type Index
- func MsTableIndexes(db XODB, schema string, table string) ([]*Index, error)
- func MyTableIndexes(db XODB, schema string, table string) ([]*Index, error)
- func OrTableIndexes(db XODB, schema string, table string) ([]*Index, error)
- func PgTableIndexes(db XODB, schema string, table string) ([]*Index, error)
- func SqTableIndexes(db XODB, table string) ([]*Index, error)
- type IndexColumn
- func MsIndexColumns(db XODB, schema string, table string, index string) ([]*IndexColumn, error)
- func MyIndexColumns(db XODB, schema string, table string, index string) ([]*IndexColumn, error)
- func OrIndexColumns(db XODB, schema string, table string, index string) ([]*IndexColumn, error)
- func PgIndexColumns(db XODB, schema string, index string) ([]*IndexColumn, error)
- func SqIndexColumns(db XODB, index string) ([]*IndexColumn, error)
- type MsIdentity
- type MyAutoIncrement
- type MyEnumValue
- type PgColOrder
- type PgGetFuncResExist
- type Proc
- type ProcParam
- type ScannerValuer
- type Sequence
- type Slice
- type SqAutoIncrement
- type SqColumn
- type StringSlice
- type Table
- func MsTables(db XODB, schema string, relkind string) ([]*Table, error)
- func MyTables(db XODB, schema string, relkind string) ([]*Table, error)
- func OrTables(db XODB, schema string, relkind string) ([]*Table, error)
- func PgTables(db XODB, schema string, relkind string) ([]*Table, error)
- func SqTables(db XODB, relkind string) ([]*Table, error)
- type XODB
Constants ¶
const ( // BookTypeFiction is the 'FICTION' BookType. BookTypeFiction = BookType(1) // BookTypeNonfiction is the 'NONFICTION' BookType. BookTypeNonfiction = BookType(2) )
Variables ¶
var XOLog = func(string, ...interface{}) {}
XOLog provides the log func used by generated queries.
Functions ¶
Types ¶
type Author ¶ added in v1.1.0
type Author struct { AuthorID int `json:"author_id"` // author_id Name string `json:"name"` // name Country sql.NullString `json:"country"` // country // contains filtered or unexported fields }
Author represents a row from 'public.authors'.
func AuthorByAuthorID ¶ added in v1.1.0
AuthorByAuthorID retrieves a row from 'public.authors' as a Author.
Generated from index 'authors_pkey'.
func AuthorByName ¶ added in v1.1.0
AuthorByName retrieves a row from 'public.authors' as a Author.
Generated from index 'authors_name_key'.
func AuthorsByName ¶ added in v1.1.0
AuthorsByName retrieves a row from 'public.authors' as a Author.
Generated from index 'authors_name_idx'.
func (*Author) Deleted ¶ added in v1.1.0
Deleted provides information if the Author has been deleted from the database.
type Book ¶ added in v1.1.0
type Book struct { BookID int `json:"book_id"` // book_id AuthorID int `json:"author_id"` // author_id Isbn string `json:"isbn"` // isbn Booktype BookType `json:"booktype"` // booktype Title string `json:"title"` // title Year int `json:"year"` // year Available time.Time `json:"available"` // available Tags StringSlice `json:"tags"` // tags // contains filtered or unexported fields }
Book represents a row from 'public.books'.
func BookByBookID ¶ added in v1.1.0
BookByBookID retrieves a row from 'public.books' as a Book.
Generated from index 'books_pkey'.
func BookByIsbn ¶ added in v1.1.0
BookByIsbn retrieves a row from 'public.books' as a Book.
Generated from index 'books_isbn_key'.
func BooksByTitle ¶ added in v1.1.0
BooksByTitle retrieves a row from 'public.books' as a Book.
Generated from index 'books_title_lower_idx'.
func BooksByTitleYear ¶ added in v1.1.0
BooksByTitleYear retrieves a row from 'public.books' as a Book.
Generated from index 'books_title_idx'.
func (*Book) Author ¶ added in v1.1.0
Author returns the Author associated with the Book's AuthorID (author_id).
Generated from foreign key 'books_author_id_fkey'.
func (*Book) Deleted ¶ added in v1.1.0
Deleted provides information if the Book has been deleted from the database.
type BookType ¶ added in v1.1.0
type BookType uint16
BookType is the 'book_type' enum type from schema 'public'.
func (BookType) MarshalText ¶ added in v1.1.0
MarshalText marshals BookType into text.
func (*BookType) Scan ¶ added in v1.1.0
Scan satisfies the database/sql.Scanner interface for BookType.
func (*BookType) UnmarshalText ¶ added in v1.1.0
UnmarshalText unmarshals BookType from text.
type Column ¶
type Column struct { FieldOrdinal int // field_ordinal ColumnName string // column_name DataType string // data_type NotNull bool // not_null DefaultValue sql.NullString // default_value IsPrimaryKey bool // is_primary_key }
Column represents column info.
func MsTableColumns ¶
MsTableColumns runs a custom query, returning results as Column.
func MyTableColumns ¶
MyTableColumns runs a custom query, returning results as Column.
func OrTableColumns ¶
OrTableColumns runs a custom query, returning results as Column.
type CrAutoincrement ¶
type CrAutoincrement struct {
TableName string // table_name
}
CrAutoincrement represents a row from '[custom cr_autoincrement]'.
func CrAutoIncrements ¶
func CrAutoIncrements(db XODB, schema string) ([]*CrAutoincrement, error)
CrAutoIncrements runs a custom query, returning results as CrAutoincrement.
type Enum ¶
type Enum struct {
EnumName string // enum_name
}
Enum represents a enum.
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 ¶
MsTableIndexes runs a custom query, returning results as Index.
func MyTableIndexes ¶
MyTableIndexes runs a custom query, returning results as Index.
func OrTableIndexes ¶
OrTableIndexes runs a custom query, returning results as Index.
func PgTableIndexes ¶
PgTableIndexes runs a custom query, returning results as Index.
type IndexColumn ¶
IndexColumn represents index column info.
func MsIndexColumns ¶
MsIndexColumns runs a custom query, returning results as IndexColumn.
func MyIndexColumns ¶
MyIndexColumns runs a custom query, returning results as IndexColumn.
func OrIndexColumns ¶
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, 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 PgGetFuncResExist ¶
type PgGetFuncResExist struct {
Exists bool // exists
}
PgGetFuncResExist represents a row from '[custom pg_get_func_res_exist]'.
func PgGetFuncResExists ¶
func PgGetFuncResExists(db XODB) ([]*PgGetFuncResExist, error)
PgGetFuncResExists runs a custom query, returning results as PgGetFuncResExist.
type Proc ¶
Proc represents a stored procedure.
type ProcParam ¶
type ProcParam struct {
ParamType string // param_type
}
ProcParam represents a stored procedure param.
func MyProcParams ¶
MyProcParams runs a custom query, returning results as ProcParam.
type ScannerValuer ¶
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]'.
type SqAutoIncrement ¶
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]'.
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.
type Table ¶
Table represents table info.
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.
Source Files ¶
- author.xo.go
- book.xo.go
- booktype.xo.go
- column.xo.go
- crautoincrement.xo.go
- enum.xo.go
- enumvalue.xo.go
- foreignkey.xo.go
- index.xo.go
- indexcolumn.xo.go
- msidentity.xo.go
- myautoincrement.xo.go
- myenumvalue.xo.go
- pgcolorder.xo.go
- pggetfuncresexist.xo.go
- proc.xo.go
- procparam.xo.go
- sequence.xo.go
- sp_sayhello.xo.go
- sqautoincrement.xo.go
- sqcolumn.xo.go
- table.xo.go
- xo_db.xo.go