Documentation ¶
Index ¶
- Constants
- func CSVToHeader(reader io.Reader) []string
- func CSVToMap(reader io.Reader) []map[string]string
- func Connect(db_path string) (*sql.DB, error)
- func Connectx(db_path string) (*sqlx.DB, error)
- func CreateTableTemplate(name string, headers []string) string
- func CreateTriggers(dbName string) string
- func DefineStruct(dbName string, fields *[]map[string]interface{}) dynamicstruct.DynamicStruct
- func GetColumnData(dbFile, dbName string) (*sqlx.Rows, error)
- func GetDB(dbName string) string
- func GetStruct(dbFile, dbName string) dynamicstruct.DynamicStruct
- func Insert(dbFile string, dbName string, insertValues map[string]interface{}) (sql.Result, error)
- func Query(dbFile string, dbName string, values JSONAPIFilter, fields JSONAPIField) (*sqlx.Rows, error)
- func RowsToJSON(rows *sqlx.Rows) *[]map[string]interface{}
- func RowsToJSONApiResponse(dbFile, dbName string, rows *sqlx.Rows, results *JSONAPIResponse)
- func Start()
- func UnmarshalStruct(rows *sqlx.Rows, retResults *JSONAPIResponse, ...)
- func Update(dbFile string, dbName string, values JSONAPIFilter, ...)
- func WriteJSONApiResponse(c *fiber.Ctx, results *JSONAPIResponse)
- type JSONAPI
- type JSONAPIField
- type JSONAPIFilter
- type JSONAPIResponse
- type StructCache
Constants ¶
View Source
const (
DEFAULT_COLUMNS = "rowid as _rowid, _created_at, _updated_at"
)
Variables ¶
This section is empty.
Functions ¶
func CSVToHeader ¶
func CSVToMap ¶
CSVToMap takes a reader and returns an array of dictionaries, using the header row as the keys
func CreateTableTemplate ¶
func CreateTriggers ¶
func DefineStruct ¶
func DefineStruct(dbName string, fields *[]map[string]interface{}) dynamicstruct.DynamicStruct
func GetStruct ¶
func GetStruct(dbFile, dbName string) dynamicstruct.DynamicStruct
func Query ¶
func Query(dbFile string, dbName string, values JSONAPIFilter, fields JSONAPIField) (*sqlx.Rows, error)
func RowsToJSON ¶
func RowsToJSONApiResponse ¶
func RowsToJSONApiResponse(dbFile, dbName string, rows *sqlx.Rows, results *JSONAPIResponse)
func UnmarshalStruct ¶
func UnmarshalStruct(rows *sqlx.Rows, retResults *JSONAPIResponse, _struct dynamicstruct.DynamicStruct)
func Update ¶
func Update(dbFile string, dbName string, values JSONAPIFilter, updatedValues map[string]interface{})
func WriteJSONApiResponse ¶
func WriteJSONApiResponse(c *fiber.Ctx, results *JSONAPIResponse)
Types ¶
type JSONAPI ¶
type JSONAPI struct { // Page map[string][]string `form:"page"` Field JSONAPIField `form:"fields"` Filter JSONAPIFilter `form:"filter"` }
type JSONAPIField ¶
type JSONAPIFilter ¶
type JSONAPIResponse ¶
type JSONAPIResponse []interface{}
func QueryAPIResonse ¶
func QueryAPIResonse(dbFile, dbName string, values JSONAPIFilter, fields JSONAPIField) (*JSONAPIResponse, error)
type StructCache ¶
type StructCache *map[string]dynamicstruct.DynamicStruct
func NewStructCache ¶
func NewStructCache() StructCache
Click to show internal directories.
Click to hide internal directories.