models

package
v0.0.0-...-defa990 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

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 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 SchemaMigration

type SchemaMigration struct {
	Version int64 `json:"version"` // version
	Dirty   bool  `json:"dirty"`   // dirty
	// contains filtered or unexported fields
}

SchemaMigration represents a row from 'public.schema_migrations'.

func SchemaMigrationByVersion

func SchemaMigrationByVersion(db XODB, version int64) (*SchemaMigration, error)

SchemaMigrationByVersion retrieves a row from 'public.schema_migrations' as a SchemaMigration.

Generated from index 'schema_migrations_pkey'.

func (*SchemaMigration) Delete

func (sm *SchemaMigration) Delete(db XODB) error

Delete deletes the SchemaMigration from the database.

func (*SchemaMigration) Deleted

func (sm *SchemaMigration) Deleted() bool

Deleted provides information if the SchemaMigration has been deleted from the database.

func (*SchemaMigration) Exists

func (sm *SchemaMigration) Exists() bool

Exists determines if the SchemaMigration exists in the database.

func (*SchemaMigration) Insert

func (sm *SchemaMigration) Insert(db XODB) error

Insert inserts the SchemaMigration to the database.

func (*SchemaMigration) Save

func (sm *SchemaMigration) Save(db XODB) error

Save saves the SchemaMigration to the database.

func (*SchemaMigration) Update

func (sm *SchemaMigration) Update(db XODB) error

Update updates the SchemaMigration in the database.

func (*SchemaMigration) Upsert

func (sm *SchemaMigration) Upsert(db XODB) error

Upsert performs an upsert for SchemaMigration.

NOTE: PostgreSQL 9.5+ only

type Slice

type Slice []ScannerValuer

Slice is a slice of ScannerValuers.

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 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