Documentation ¶
Index ¶
- Constants
- func Close()
- func Connect(options *ConnectOption) *sqlx.DB
- func DropDatabase(dbURL string) error
- func ExecuteQuery(queryName string, data interface{}) (sql.Result, error)
- func Fetch(dest interface{}, ids ...interface{}) error
- func Get(dest interface{}, queryName string, args ...interface{}) error
- func GetDB() *sqlx.DB
- func LoadQuery(queryName string) (string, error)
- func LoadRelations(model Model) error
- func Query(ctx context.Context, queryName string, args ...interface{}) (*sqlx.Rows, error)
- func QuerySelect(queryName string, dest interface{}, args ...interface{}) error
- func Queryx(queryName string, args ...interface{}) (*sqlx.Rows, error)
- func TxExecuteQuery(tx *sqlx.Tx, queryName string, data interface{}) (sql.Result, error)
- func TxQuery(ctx context.Context, tx *sqlx.Tx, queryName string, args ...interface{}) (*sqlx.Rows, error)
- func UnmarshalJSONTextFields(input interface{}) error
- type ConnectOption
- type FetchList
- type Filter
- type Model
- type Paginate
- type Relation
Constants ¶
const QUERY_NAME = "relations"
Variables ¶
This section is empty.
Functions ¶
func Connect ¶
func Connect(options *ConnectOption) *sqlx.DB
Connect initializes the database connection and sets up the circuit breaker
func DropDatabase ¶
func ExecuteQuery ¶
ExecuteQuery is a general function to execute a write operation (INSERT, UPDATE, DELETE) with a circuit breaker
func Fetch ¶
func Fetch(dest interface{}, ids ...interface{}) error
Get retrieves multiple records from the database with pagination
func LoadRelations ¶
func Query ¶
Query is a general function to execute a read operation that returns multiple rows with a circuit breaker
func QuerySelect ¶
QuerSelect is a general function to execute a read operation that returns multiple rows with a circuit breaker
func Queryx ¶
Query is a general function to execute a read operation that returns multiple rows with a circuit breaker
func TxExecuteQuery ¶
TxExecuteQuery is a general function to execute a write operation (INSERT, UPDATE, DELETE) with a circuit breaker
func UnmarshalJSONTextFields ¶
func UnmarshalJSONTextFields(input interface{}) error
UnmarshalJSONTextFields processes a single struct or a slice of structs to unmarshal fields of type types.JSONText into corresponding Go struct fields based on matching `db` and `json` tags.