Documentation ¶
Index ¶
- type CountRequest
- type CountResponse
- type CreateRequest
- type CreateResponse
- type DbService
- func (t *DbService) Count(request *CountRequest) (*CountResponse, error)
- func (t *DbService) Create(request *CreateRequest) (*CreateResponse, error)
- func (t *DbService) Delete(request *DeleteRequest) (*DeleteResponse, error)
- func (t *DbService) Read(request *ReadRequest) (*ReadResponse, error)
- func (t *DbService) Truncate(request *TruncateRequest) (*TruncateResponse, error)
- func (t *DbService) Update(request *UpdateRequest) (*UpdateResponse, error)
- type DeleteRequest
- type DeleteResponse
- type ReadRequest
- type ReadResponse
- type TruncateRequest
- type TruncateResponse
- type UpdateRequest
- type UpdateResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CountRequest ¶ added in v4.3.0
type CountRequest struct { // specify the table name Table string `json:"table"` }
type CountResponse ¶ added in v4.3.0
type CountResponse struct { // the number of records in the table Count int32 `json:"count"` }
type CreateRequest ¶
type CreateResponse ¶
type CreateResponse struct { // The id of the record (either specified or automatically created) Id string `json:"id"` }
type DbService ¶
type DbService struct {
// contains filtered or unexported fields
}
func NewDbService ¶
func (*DbService) Count ¶ added in v4.3.0
func (t *DbService) Count(request *CountRequest) (*CountResponse, error)
Count records in a table
func (*DbService) Create ¶
func (t *DbService) Create(request *CreateRequest) (*CreateResponse, error)
Create a record in the database. Optionally include an "id" field otherwise it's set automatically.
func (*DbService) Delete ¶
func (t *DbService) Delete(request *DeleteRequest) (*DeleteResponse, error)
Delete a record in the database by id.
func (*DbService) Read ¶
func (t *DbService) Read(request *ReadRequest) (*ReadResponse, error)
Read data from a table. Lookup can be by ID or via querying any field in the record.
func (*DbService) Truncate ¶
func (t *DbService) Truncate(request *TruncateRequest) (*TruncateResponse, error)
Truncate the records in a table
func (*DbService) Update ¶
func (t *DbService) Update(request *UpdateRequest) (*UpdateResponse, error)
Update a record in the database. Include an "id" in the record to update.
type DeleteRequest ¶
type DeleteResponse ¶
type DeleteResponse struct { }
type ReadRequest ¶
type ReadRequest struct { // Read by id. Equivalent to 'id == "your-id"' Id string `json:"id"` // Maximum number of records to return. Default limit is 25. // Maximum limit is 1000. Anything higher will return an error. Limit int32 `json:"limit"` Offset int32 `json:"offset"` // 'asc' (default), 'desc' Order string `json:"order"` // field name to order by OrderBy string `json:"orderBy"` // Examples: 'age >= 18', 'age >= 18 and verified == true' // Comparison operators: '==', '!=', '<', '>', '<=', '>=' // Logical operator: 'and' // Dot access is supported, eg: 'user.age == 11' // Accessing list elements is not supported yet. Query string `json:"query"` // Optional table name. Defaults to 'default' Table string `json:"table"` }
type ReadResponse ¶
type ReadResponse struct { // JSON encoded records Records []map[string]interface{} `json:"records"` }
type TruncateRequest ¶
type TruncateRequest struct { // Optional table name. Defaults to 'default' Table string `json:"table"` }
type TruncateResponse ¶
type TruncateResponse struct { // The table truncated Table string `json:"table"` }
type UpdateRequest ¶
type UpdateResponse ¶
type UpdateResponse struct { }
Click to show internal directories.
Click to hide internal directories.