Documentation
¶
Index ¶
- func DatabaseConnect() *sqlx.DB
- type Database
- func (db Database) CreateSchema(k string, props map[string]*openapi3.SchemaRef)
- func (db Database) DeleteModel(id string, modelName string, r *http.Request) utils.JSONResponse
- func (db Database) GetModels(model string) utils.JSONResponse
- func (db Database) PostModel(modelName string, model *openapi3.SchemaRef, r *http.Request) utils.JSONResponse
- func (db Database) PutModel(id string, modelName string, model *openapi3.SchemaRef, r *http.Request) utils.JSONResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DatabaseConnect ¶
DatabaseConnect loads connection strings from the config file and connects to the specified DB
Types ¶
type Database ¶
Database holds the db connection and sould implement support for creation, retrieval, adding, updating and deleting
func (Database) CreateSchema ¶
CreateSchema generates a creation string from a model and executes
func (Database) DeleteModel ¶
DeleteModel removes an existing entry
func (Database) GetModels ¶
func (db Database) GetModels(model string) utils.JSONResponse
GetModels queries a table of a model and returns all those that match
Click to show internal directories.
Click to hide internal directories.