-
configure DB connection strings in
config.yml
There are two databases there,appdb
where report's configuration will be stored anddatadb
where data to analise is stored. It can be the same database. -
build the backend
go build
- start the service
# generate test data, optional
./metadb --demodata
# run the service
./metadb --scheme ./demodata/meta.yml
- update client side sample to use your backend (change the
url
property tohttp://localhost:8014/
)
Schema for the demodata is stored in demodata/meta.yml.
This file describes available objects, their fields and relations. Content of the file is a serialization of DBInfo structure from the main.go file.
Supported fields types are
- number
- date
- string
- picklist (list of hardcoded options)
- reference (key to a different model)
- name - name shown in report builder
- filter - true/false, allow/deny filtering by the field
- key - true/false, primary key (used for references)
- label - true/false, mark field as object label (will be shown in place of reference)
- ref - id of referenced model/picklist (if any)
# show cli help
./metadb --help
# generate meta.yml from DB
./metadb --save ./meta.yml