database

package
v0.0.0-...-4dd6f99 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 12, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

*******************************************************************

Author Oliviero Taleghani Date 2024-05-08

Description Part of the database package. Responsible for parsing the resulting [][]interface{}s coming from a non struct-specific query. This functions are used to convert a general array of interfaces back into their respective structure.

Usage

func parseItem(rows [][]interface{}) (result []Item, err error)

Converts [][]interface{} to []Item

Dependency

"reflect"

Todo

  • [ ] Add the other types

Changelog

[0.0.1]   2024-05-08
Added     Initial release

*******************************************************************

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDatabase

func CreateDatabase(path string) error

func DeleteItem

func DeleteItem(item Item, path string) error

func PutItem

func PutItem(item Item, path string) error

func Select

func Select(ref *[]Table, table Table, path string, where string) error

Types

type Category

type Category struct {
	Id          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
}

type Item

type Item struct {
	Id             string `json:"id"`
	Name           string `json:"name"`
	Description    string `json:"description"`
	Archived       bool   `json:"archived"`
	Position_id    string `json:"position_id"`
	Category_id    string `json:"category_id"`
	SubCategory_id string `json:"subcategory_id"`
}

func GetItemById

func GetItemById(item Item, path string) (Item, error)

func GetItems

func GetItems(item Item, path string, where string) ([]Item, error)

type SubCategory

type SubCategory struct {
	Id          string `json:"id"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Category_id string `json:"category_id"`
}

type Table

type Table interface{}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL