https://github.com/hubspot/httpql
A small library for converting URL query arguments into SQL queries.
https://github.com/hubspot/httpql
Last synced: 9 months ago
JSON representation
A small library for converting URL query arguments into SQL queries.
- Host: GitHub
- URL: https://github.com/hubspot/httpql
- Owner: HubSpot
- License: apache-2.0
- Created: 2016-02-24T15:07:44.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2025-09-29T19:55:18.000Z (9 months ago)
- Last Synced: 2025-09-29T21:44:21.449Z (9 months ago)
- Language: Java
- Size: 333 KB
- Stars: 21
- Watchers: 153
- Forks: 15
- Open Issues: 2
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGES.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
httpQL Documentation
====================
*httpQL* is a small library for converting URL query arguments into SQL queries.
Given the following URL::
http://example.com/?name=bob&age__gt=20&order=-age
And an annotated POJO::
@QueryConstraints(defaultLimit = 10, maxLimit = 100, maxOffset = 100)
class Person {
@FilterBy(Equal.class)
String name;
@FilterBy({Equal.class, GreaterThan.class})
@OrderBy
Integer age;
// Getters/Setters elided
}
*httpQL* will generate the query::
SELECT * FROM person
WHERE (`name` = 'bob' AND `age` > 20)
ORDER BY `age` DESC LIMIT 10 OFFSET 0;
Which you can then execute using your favorite driver, library, etc.
Sound cool? `Get reading, then!`_
.. _Rosetta: https://github.com/HubSpot/Rosetta
.. _Jackson: http://wiki.fasterxml.com/JacksonHome
.. _Get reading, then!: http://github.hubspot.com/httpQL/
Class Loader StackOverflow Issue
-------
* Sometimes when including ``httpQL`` in your project you will run into intermittent issues where ``java.lang.ClassLoader.loadClass`` will throw a ``StackOverflow`` error. This is because your thread runs out of stack when trying to include all of the necessary classes. You can fix this by increasing your thread stack size with this deploy config option: ``JVM_STACK_SIZE: 384k``. It is only recommended to do this if you run into this issue.
.. |BlazarShield| image:: https://private.hubapi.com/blazar/v2/branches/state/9954/shield
.. _BlazarShield: https://private.hubteam.com/blazar/builds/branch/9954