Documentation
¶
Index ¶
- Constants
- Variables
- type Field
- type FieldBool
- type FieldInt64
- type FieldString
- func (c *FieldString) GetString(v string)
- func (c FieldString) MarshalJSON() ([]byte, error)
- func (c *FieldString) SetField(other FieldString)
- func (c *FieldString) SetNull()
- func (c *FieldString) SetString(v string)
- func (c FieldString) String() string
- func (c *FieldString) UnmarshalJSON(data []byte) error
- type FieldTime
- type Resultset
- type ResultsetFunc
- type SqlDb
- func (sqlDb *SqlDb) Begin() error
- func (sqlDb *SqlDb) Close() error
- func (sqlDb *SqlDb) Commit() error
- func (sqlDb *SqlDb) Execute(sqlcmd string, args ...any) (int64, error)
- func (sqlDb *SqlDb) Health() error
- func (sqlDb *SqlDb) Init(driver, dsn string) error
- func (sqlDb *SqlDb) Query(sqlcmd string, args ...any) (*Resultset, error)
- func (sqlDb *SqlDb) QueryPaged(fn ResultsetFunc, pageRowCount int, sqlcmd string, args ...any) (int, error)
- func (sqlDb *SqlDb) Rollback() error
Constants ¶
View Source
const ( FlagNameDbPingTimeout = "db.ping.timeout" FlagNameDbQueryTimeout = "db.query.timeout" FlagNameDbMaxIdle = "db.max.idle" FlagNameDbMaxOpen = "db.max.open" FlagNameDbMaxLifetime = "db.max.lifetime" )
Variables ¶
View Source
var ( FlagDbPingTimeout = common.SystemFlagInt(FlagNameDbPingTimeout, 3*1000, "Database ping timeout") FlagDbQueryTimeout = common.SystemFlagInt(FlagNameDbQueryTimeout, 120*1000, "Database query timeout") FlagDbMaxIdle = common.SystemFlagInt(FlagNameDbMaxIdle, 0, "Database max idle connections") FlagMaxOpen = common.SystemFlagInt(FlagNameDbMaxOpen, 0, "Database max open connections") FlagMaxLifetime = common.SystemFlagInt(FlagNameDbMaxLifetime, 0, "Database connection max lifetime") )
Functions ¶
This section is empty.
Types ¶
type FieldBool ¶
func NewFieldBool ¶
func (FieldBool) MarshalJSON ¶
func (*FieldBool) UnmarshalJSON ¶
type FieldInt64 ¶
func NewFieldInt64 ¶
func NewFieldInt64(v ...int64) FieldInt64
func (*FieldInt64) Int64 ¶
func (c *FieldInt64) Int64() int64
func (FieldInt64) MarshalJSON ¶
func (c FieldInt64) MarshalJSON() ([]byte, error)
func (*FieldInt64) SetInt64 ¶
func (c *FieldInt64) SetInt64(v int64)
func (*FieldInt64) SetNull ¶
func (c *FieldInt64) SetNull()
func (FieldInt64) String ¶
func (c FieldInt64) String() string
func (*FieldInt64) UnmarshalJSON ¶
func (c *FieldInt64) UnmarshalJSON(data []byte) error
type FieldString ¶
type FieldString struct {
sql.NullString
}
func NewFieldString ¶
func NewFieldString(v ...string) FieldString
func (*FieldString) GetString ¶
func (c *FieldString) GetString(v string)
func (FieldString) MarshalJSON ¶
func (c FieldString) MarshalJSON() ([]byte, error)
func (*FieldString) SetField ¶
func (c *FieldString) SetField(other FieldString)
func (*FieldString) SetNull ¶
func (c *FieldString) SetNull()
func (*FieldString) SetString ¶
func (c *FieldString) SetString(v string)
func (FieldString) String ¶
func (c FieldString) String() string
func (*FieldString) UnmarshalJSON ¶
func (c *FieldString) UnmarshalJSON(data []byte) error
type FieldTime ¶
func NewFieldTime ¶
func (FieldTime) MarshalJSON ¶
func (*FieldTime) UnmarshalJSON ¶
type Resultset ¶
type Resultset struct {
ColumnNames []string
ColumnTypes []*sql.ColumnType
RowCount int
Rows any
}
type ResultsetFunc ¶
type SqlDb ¶
func (*SqlDb) QueryPaged ¶
Click to show internal directories.
Click to hide internal directories.