JDBQ: A Database Access Framework for Java + BigQuery

In my opinion, JDBI is simply the best database access framework for relational databases available for Java today. My new library, JDBQ, is essentially a port of JDBI from relational databases to Google BigQuery.

JDBQ Design Goals
JDBQ Design Goals

My opinions on ORMs are known, so you can probably guess JDBQ isn’t an ORM. Rather, it is an opinionated framework that structures how applications interact with BigQuery, and successfully treads the line between opinionated enough to create structure without feeling pedantic; lightweight enough to make working with databases more efficient as opposed to just different; and is fully transparent regarding the SQL it generates and executes.

Much like JDBI, JDBQ was written with the following design goals in mind:

  • Transparent
    • Exposes and embraces SQL, as opposed to hiding it
    • Exposes and embraces BigQuery client, as opposed to hiding it
  • Opinionated
    • Encourage good application design principles (e.g., decoupled query logic and de/serialization) through framework structure
  • Domain-Oriented
    • Supports integrating domain objects into SQL generation and de/serialization
  • Customizable
    • Pluggable and customizable templating engines
    • Filter-style query customizers

JDBQ also includes a new feature, QueryFragment, that I feel is a piece missing from JDBI itself. It allows users to create fully self-contained query clauses that improve modularity and reusability of query generation.

I hope you find JDBQ to be useful! If you try it and like it, please drop a comment here so I can see how it’s being used!