dgwexample

package
v0.0.0-...-135fc89 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OpenDB

func OpenDB(connStr string) (*sql.DB, error)

OpenDB opens database connection

Types

type Queryer

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

Queryer database/sql compatible query interface

type T1

type T1 struct {
	ID          int64          // id
	I           int            // i
	Str         string         // str
	NumFloat    float64        // num_float
	NullableStr sql.NullString // nullable_str
	TWithTz     time.Time      // t_with_tz
	TWithoutTz  time.Time      // t_without_tz
	NullableTz  *time.Time     // nullable_tz
	JSONData    []byte         // json_data
	XMLData     []byte         // xml_data
}

T1 represents public.t1

func GetT1ByPk

func GetT1ByPk(db Queryer, pk0 int64) (*T1, error)

GetT1ByPk select the T1 from the database.

func GetT1TableByPk

func GetT1TableByPk(db Queryer, pk0 int64) (*T1, error)

GetT1TableByPk select the T1 from the database.

func (*T1) Create

func (r *T1) Create(db Queryer) error

Create inserts the T1 to the database.

type T1Table

type T1Table struct {
	ID          int64          // id
	I           int            // i
	Str         string         // str
	NumFloat    float64        // num_float
	NullableStr sql.NullString // nullable_str
	TWithTz     time.Time      // t_with_tz
	TWithoutTz  time.Time      // t_without_tz
	NullableTz  *time.Time     // nullable_tz
	JSONData    []byte         // json_data
	XMLData     []byte         // xml_data
}

T1Table represents public.t1

func (*T1Table) Create

func (r *T1Table) Create(db Queryer) error

Create inserts the T1 to the database.

type T2

type T2 struct {
	ID         int64     // id
	I          int       // i
	Str        string    // str
	TWithTz    time.Time // t_with_tz
	TWithoutTz time.Time // t_without_tz
}

T2 represents public.t2

func GetT2ByPk

func GetT2ByPk(db Queryer, pk0 int64, pk1 int) (*T2, error)

GetT2ByPk select the T2 from the database.

func GetT2TableByPk

func GetT2TableByPk(db Queryer, pk0 int64, pk1 int) (*T2, error)

GetT2TableByPk select the T2 from the database.

func (*T2) Create

func (r *T2) Create(db Queryer) error

Create inserts the T2 to the database.

type T2Table

type T2Table struct {
	ID         int64     // id
	I          int       // i
	Str        string    // str
	TWithTz    time.Time // t_with_tz
	TWithoutTz time.Time // t_without_tz
}

T2Table represents public.t2

func (*T2Table) Create

func (r *T2Table) Create(db Queryer) error

Create inserts the T2 to the database.

type T3

type T3 struct {
	ID int // id
	I  int // i
}

T3 represents public.t3

func GetT3ByPk

func GetT3ByPk(db Queryer, pk0 int, pk1 int) (*T3, error)

GetT3ByPk select the T3 from the database.

func GetT3TableByPk

func GetT3TableByPk(db Queryer, pk0 int, pk1 int) (*T3, error)

GetT3TableByPk select the T3 from the database.

func (*T3) Create

func (r *T3) Create(db Queryer) error

Create inserts the T3 to the database.

type T3Table

type T3Table struct {
	ID int // id
	I  int // i
}

T3Table represents public.t3

func (*T3Table) Create

func (r *T3Table) Create(db Queryer) error

Create inserts the T3 to the database.

type T4

type T4 struct {
	ID int // id
	I  int // i
}

T4 represents public.t4

func GetT4ByPk

func GetT4ByPk(db Queryer, pk0 int, pk1 int) (*T4, error)

GetT4ByPk select the T4 from the database.

func GetT4TableByPk

func GetT4TableByPk(db Queryer, pk0 int, pk1 int) (*T4, error)

GetT4TableByPk select the T4 from the database.

func (*T4) Create

func (r *T4) Create(db Queryer) error

Create inserts the T4 to the database.

type T4Table

type T4Table struct {
	ID int // id
	I  int // i
}

T4Table represents public.t4

func (*T4Table) Create

func (r *T4Table) Create(db Queryer) error

Create inserts the T4 to the database.

type UserAccount

type UserAccount struct {
	ID        int64  // id
	Email     string // email
	LastName  string // last_name
	FirstName string // first_name
}

UserAccount represents public.user_account

func GetUserAccountByPk

func GetUserAccountByPk(db Queryer, pk0 int64) (*UserAccount, error)

GetUserAccountByPk select the UserAccount from the database.

func GetUserAccountTableByPk

func GetUserAccountTableByPk(db Queryer, pk0 int64) (*UserAccount, error)

GetUserAccountTableByPk select the UserAccount from the database.

func (*UserAccount) Create

func (r *UserAccount) Create(db Queryer) error

Create inserts the UserAccount to the database.

type UserAccountCompositePk

type UserAccountCompositePk struct {
	ID        int64  // id
	Email     string // email
	LastName  string // last_name
	FirstName string // first_name
}

UserAccountCompositePk represents public.user_account_composite_pk

func GetUserAccountCompositePkByPk

func GetUserAccountCompositePkByPk(db Queryer, pk0 int64, pk1 string) (*UserAccountCompositePk, error)

GetUserAccountCompositePkByPk select the UserAccountCompositePk from the database.

func GetUserAccountCompositePkTableByPk

func GetUserAccountCompositePkTableByPk(db Queryer, pk0 int64, pk1 string) (*UserAccountCompositePk, error)

GetUserAccountCompositePkTableByPk select the UserAccountCompositePk from the database.

func (*UserAccountCompositePk) Create

func (r *UserAccountCompositePk) Create(db Queryer) error

Create inserts the UserAccountCompositePk to the database.

type UserAccountCompositePkTable

type UserAccountCompositePkTable struct {
	ID        int64  // id
	Email     string // email
	LastName  string // last_name
	FirstName string // first_name
}

UserAccountCompositePkTable represents public.user_account_composite_pk

func (*UserAccountCompositePkTable) Create

Create inserts the UserAccountCompositePk to the database.

type UserAccountTable

type UserAccountTable struct {
	ID        int64  // id
	Email     string // email
	LastName  string // last_name
	FirstName string // first_name
}

UserAccountTable represents public.user_account

func (*UserAccountTable) Create

func (r *UserAccountTable) Create(db Queryer) error

Create inserts the UserAccount to the database.

type UserAccountUUID

type UserAccountUUID struct {
	UUID      string // uuid
	Email     string // email
	LastName  string // last_name
	FirstName string // first_name
}

UserAccountUUID represents public.user_account_uuid

func GetUserAccountUUIDByPk

func GetUserAccountUUIDByPk(db Queryer, pk0 string) (*UserAccountUUID, error)

GetUserAccountUUIDByPk select the UserAccountUUID from the database.

func GetUserAccountUUIDTableByPk

func GetUserAccountUUIDTableByPk(db Queryer, pk0 string) (*UserAccountUUID, error)

GetUserAccountUUIDTableByPk select the UserAccountUUID from the database.

func (*UserAccountUUID) Create

func (r *UserAccountUUID) Create(db Queryer) error

Create inserts the UserAccountUUID to the database.

type UserAccountUUIDTable

type UserAccountUUIDTable struct {
	UUID      string // uuid
	Email     string // email
	LastName  string // last_name
	FirstName string // first_name
}

UserAccountUUIDTable represents public.user_account_uuid

func (*UserAccountUUIDTable) Create

func (r *UserAccountUUIDTable) Create(db Queryer) error

Create inserts the UserAccountUUID to the database.

Jump to

Keyboard shortcuts

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