db2rest
db2rest copied to clipboard
Load jinjia SQL templates from file system
For templatized SQL all templates should be created with Jinjia.
Jinjia for Java - https://github.com/HubSpot/jinjava
Acceptance Tasks:
- [ ] Must be able to read from the file system for jar-based deployments.
- [ ] Must be able to load from docker volumes.
- [ ] Only one folder with multiple SQL files(jinjia format) to be supported.
- [ ] Update documentation on website https://github.com/9tigerio/db2rest-web/issues/7
Example SQL File
SELECT * FROM public.users
WHERE age >= {{ context.params.age }};
The first one uses request parameters.
SELECT * FROM public.users
WHERE id = {{ context.paths.id }};
The second one uses path variables.
SELECT * FROM public.users
WHERE id = {{ context.headers.id }};
The third one uses http header variables.
I think Pebble might be better option as discussed in Discord thread? dunno.
Will check.
Just for confirm, the API end-point for this feature is: api/v1/sql/<filename>
Yes that's correct.
On Sun, Sep 8, 2024, 5:12 PM Nguyễn Tấn Anh @.***> wrote:
Just for confirm, the API end-point for this feature is: api/v1/sql/
— Reply to this email directly, view it on GitHub https://github.com/kdhrubo/db2rest/issues/670#issuecomment-2336841475, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAISPRAHAGAHL4UNIBB2WLDZVTDULAVCNFSM6AAAAABMYVKPPOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMZWHA2DCNBXGU . You are receiving this because you authored the thread.Message ID: @.***>