Documentation ¶
Index ¶
- func NewReader(i any) (r io.Reader, err error)
- type CountType
- type DB
- func (db *DB) Debug() *DB
- func (db *DB) Exec() (err error)
- func (db *DB) GetCount() (count int)
- func (db *DB) GetDBResponse() (dbResponse *DBResponse)
- func (db *DB) GetRange() (start, end int)
- func (db *DB) Input(input any) *DB
- func (db *DB) IsSuccess() (success bool)
- func (db *DB) Limit(limit int) *DB
- func (db *DB) NewDelete() *DB
- func (db *DB) NewInsert() *DB
- func (db *DB) NewSelect() *DB
- func (db *DB) NewUpdate() *DB
- func (db *DB) NewUpsert() *DB
- func (db *DB) Offset(offset int) *DB
- func (db *DB) Output(output any) *DB
- func (db *DB) RPC(funcName string) *DB
- func (db *DB) Select(col ...string) *DB
- func (db *DB) SetHeader(key, value string) *DB
- func (db *DB) SetQuery(key, value string) *DB
- func (db *DB) SetRole(role string) *DB
- func (db *DB) Table(tableName string) *DB
- func (db *DB) Where(field string, ft FilterType, value string) *DB
- func (db *DB) WhereIn(field string, values []string) *DB
- func (db *DB) WithCount(ct CountType) *DB
- type DBResponse
- type FilterType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DB ¶
type DB struct {
// contains filtered or unexported fields
}
DB - remote DB information
func (*DB) GetDBResponse ¶
func (db *DB) GetDBResponse() (dbResponse *DBResponse)
GetDBResponse - returns the database response
func (*DB) NewUpsert ¶
NewUpsert - returns a new instance for inserting or updating data (if exists)
func (*DB) Output ¶
Output - structure to save a single result from PostgREST instance, remember to pass a pointer to the 'output'
func (*DB) SetHeader ¶
SetHeader - sets custom header for PostgREST to support features not immediately implemented by this library
func (*DB) SetQuery ¶
SetQuery - sets custom query parameters for PostgREST to support features not immediately implemented by this library
func (*DB) Where ¶
func (db *DB) Where(field string, ft FilterType, value string) *DB
Where - filter result rows by adding conditions on columns
type DBResponse ¶
type DBResponse struct { Code string `json:"code,omitempty"` Details string `json:"details,omitempty"` Hint string `json:"hint,omitempty"` Message string `json:"message,omitempty"` HTTPStatusCode int `json:"httpStatusCode,omitempty"` }
DBResponse - database response
func (*DBResponse) HasCode ¶
func (dbResponse *DBResponse) HasCode() (b bool)
func (*DBResponse) String ¶
func (dbResponse *DBResponse) String() (str string)
type FilterType ¶
type FilterType uint8
const ( Equal FilterType = iota + 1 GreaterThan GreaterThanEqual LessThan LessThanEqual NotEqual )
const ( CountTypeExact FilterType = iota + 1 CountTypePlanned CountTypeEstimated )
func (FilterType) String ¶
func (ft FilterType) String() (str string)
Click to show internal directories.
Click to hide internal directories.