A java library that exposes a restful api for the management and consumption of sql reports.
- embers/admin/ - allows reports to be added, updated or deleted dynamically.
- embers/query/ - run the named sql select query and return the result via http - as CSV.
- embers/cached/ - fetch a cached result, or run and cache if cache miss.
Embed embers in a http container that works with javax.ws.rs
.
You'll need to wire it up and give it a servlet:
- A Jetty example: EmbersJettyServer
- A Spring example: EmbersSpringConfiguration
And inject a javax.sql.DataSource
into adf.embers.configuration.EmbersRepositoryConfiguration
The datasource should have access to the 3 tables required by embers, and have read access to the tables the sql reports are to be run against.
Embers Database tables:
- queries - Holds details of the queries that embers/query can run.
- queries_statistics - Audit information about calls made to embers/query.
- query_result_cache - Caches results for embers/cache service to re-use.
Example of DDL for tables: EmbersDatabase
To run the build, it requires a java jdk 11+. Its compiled source targets java 1.8.
./gradlew clean build
The acceptance tests produce html documentation with sequence diagrams, thanks to Yatspec.
I've copied it into the docs/
folder for perusing on github.
- admin - Setting up the available sql queries.
- query - Using an sql report.
- query statistics - Stats on the existing sql queries.
- cached queries - Using a cached query result.
- e2e - End 2 end example, maintaining and using an sql query.
powered by jacoco plugin, run:
gradlew clean codeCoverageReport
Code coverage reports will be available here: embers/build/reports/jacoco/index.html
and sum unit and acceptance tests.
Thanks to circleci, you can see the build here: https://app.circleci.com/pipelines/github/alfanse/embers
Configured by: (.circleci/config.yml)[.circleci/config.yml]
You can view the documentation generated by the acceptance tests there as well, look in the ARTIFACTS
tab of a build.
These links don't live long, but you can try:
?? what would you like to see here ??