A service base for a ruby micro service using Sequel
Installation
As described by the main readme.
Usage
Health Check
You can use the health_check executable to provide a method of checking the health of the server (database included). For example within a docker file like this:
HEALTHCHECK --interval=30s --timeout=30s --start-period=30s --retries=3 CMD [ "bundle", "exec", "health_check" ]
This makes use of an exposed endpoint called /health_check, which you can only use for a custom ping to check for it.
Default responses
This also provides some default json responses to be used in your controller. See responses.rb for more details.
To use these responses let your ApplicationController inherit from ApiBaseController and you are set.
Oracle Binding Variables
This Gem automatically interrupts all Oracle DB statements and substitues the values with binding variables.
It is possible to deactivate this behaviour:
Sequel::Oracle::Database.skip_binding_variables = true
Beware that this is a global setting which de-/activates binding variables for the whole application.
Parameter handling
You get automatically camelCase to snake_case transformation for the request and the reverse for responses via the olive_branch gem.
There will be a default parameter filtering enabled. It filters passwords of various key names in development and everything in production.