api: implement pagination for search

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
db: fix typo in ddl.sql

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
StreamyResultSet: fix db connections leak

Optimize the call too by bailing out early when possible.

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
api: fix pagination bugs

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
config: configure ActiveRecord logging

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
spec: fix tests failures

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
spec: lower log level in tests

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>