Documentation
¶
Index ¶
- type DBTX
- type GetOrderByIdNewRow
- type MySqlConfig
- func (m *MySqlConfig) GetConnMaxIdleTimeInSec() int
- func (m *MySqlConfig) GetConnMaxLifetimeInSec() int
- func (m *MySqlConfig) GetDatabase() string
- func (m *MySqlConfig) GetHost() string
- func (m *MySqlConfig) GetMaxIdleConnection() int
- func (m *MySqlConfig) GetMaxOpenConnection() int
- func (m *MySqlConfig) GetPassword() string
- func (m *MySqlConfig) GetPort() int
- func (m *MySqlConfig) GetUser() string
- func (m *MySqlConfig) SetupDefault()
- type Order
- type Querier
- type Queries
- func (q *Queries) Close() error
- func (q *Queries) GetAllOrders(ctx context.Context) ([]*Order, error)
- func (q *Queries) GetOrderByID(ctx context.Context, orderID string) (*Order, error)
- func (q *Queries) GetOrderByIdNew(ctx context.Context, orderID string) (*GetOrderByIdNewRow, error)
- func (q *Queries) WithTx(tx *sql.Tx) *Queries
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GetOrderByIdNewRow ¶
type MySqlConfig ¶
type MySqlConfig struct {
Database string `yaml:"database"`
Host string `yaml:"host"`
Port int `yaml:"port"`
User string `yaml:"user"`
Password string `yaml:"password"`
MaxIdleConnection int `yaml:"max_idle_connections"`
MaxOpenConnection int `yaml:"max_open_connections"`
ConnMaxLifetimeInSec int `yaml:"connection_max_lifetime_sec"`
ConnMaxIdleTimeInSec int `yaml:"connection_max_idle_time_sec"`
}
func (*MySqlConfig) GetConnMaxIdleTimeInSec ¶
func (m *MySqlConfig) GetConnMaxIdleTimeInSec() int
GetConnMaxIdleTimeInSec returns the connection max idle time in seconds
func (*MySqlConfig) GetConnMaxLifetimeInSec ¶
func (m *MySqlConfig) GetConnMaxLifetimeInSec() int
GetConnMaxLifetimeInSec returns the connection max lifetime in seconds
func (*MySqlConfig) GetDatabase ¶
func (m *MySqlConfig) GetDatabase() string
GetDatabase returns the database name
func (*MySqlConfig) GetHost ¶
func (m *MySqlConfig) GetHost() string
GetHost returns the database host
func (*MySqlConfig) GetMaxIdleConnection ¶
func (m *MySqlConfig) GetMaxIdleConnection() int
GetMaxIdleConnection returns the maximum idle connections
func (*MySqlConfig) GetMaxOpenConnection ¶
func (m *MySqlConfig) GetMaxOpenConnection() int
GetMaxOpenConnection returns the maximum open connections
func (*MySqlConfig) GetPassword ¶
func (m *MySqlConfig) GetPassword() string
GetPassword returns the database password
func (*MySqlConfig) GetUser ¶
func (m *MySqlConfig) GetUser() string
GetUser returns the database user
func (*MySqlConfig) SetupDefault ¶
func (m *MySqlConfig) SetupDefault()
type Querier ¶
type Querier interface {
//GetAllOrders
//
// SELECT order_id, order_qty, amount, created_at, updated_at
// FROM orders
// ORDER BY created_at DESC
GetAllOrders(ctx context.Context) ([]*Order, error)
//GetOrderByID
//
// SELECT order_id, order_qty, amount, created_at, updated_at
// FROM orders
// WHERE order_id = ?
GetOrderByID(ctx context.Context, orderID string) (*Order, error)
//GetOrderByIdNew
//
// SELECT order_id, order_qty
// FROM orders
// WHERE order_id = ?
GetOrderByIdNew(ctx context.Context, orderID string) (*GetOrderByIdNewRow, error)
}
type Queries ¶
type Queries struct {
// contains filtered or unexported fields
}
func (*Queries) GetAllOrders ¶
GetAllOrders
SELECT order_id, order_qty, amount, created_at, updated_at FROM orders ORDER BY created_at DESC
func (*Queries) GetOrderByID ¶
GetOrderByID
SELECT order_id, order_qty, amount, created_at, updated_at FROM orders WHERE order_id = ?
func (*Queries) GetOrderByIdNew ¶
GetOrderByIdNew
SELECT order_id, order_qty FROM orders WHERE order_id = ?
Click to show internal directories.
Click to hide internal directories.