1.2.0 • Published 8 years ago
reportsdb v1.2.0
ReportsDB
Create reports from an sqlite datebase and a template using SQL and Pug with Big.js JavaScript math.
These reports can be rendered in:
- CSV
- HTML
Install
$ npm i -g reportsdbCommands
Help
$ reportsdb -h
$ reportsdb toPDF -hCreate project by copying the example
$ reportsdb init .This will create a boilerplate on which to work on.
/db.sqlite
/.editorconfig
/files/
/reports/
/scripts/
/scripts/inputFood.sh
/templates/
/templates/Food/
/templates/Food/html.pug
/templates/Food/query.sqlCreate report
Generating a report will read the html.pug and query.sql inside the given template directory. Output file is located in reports.
Filtering is possible by year
-y <YYYY>(and quater-q <Q>). A--select <column>option is required. The--selectoption will also reorder by said column date (with or without year (& quater) filter).
$ reportsdb toPDF ./examples/templates/Food/CSV
$ reportsdb toCSV ./examples/templates/Food/HTML
$ reportsdb toHTML ./examples/templates/Food/