Skip to content

feat: Add exposed-postgres module with hstore support - #2912

Open
Matthew de Detrich (mdedetrich) wants to merge 1 commit into
JetBrains:mainfrom
mdedetrich:add-exposed-postgres-with-initial-hstore-implementation
Open

Matthew de Detrich (mdedetrich) wants to merge 1 commit into
JetBrains:mainfrom
mdedetrich:add-exposed-postgres-with-initial-hstore-implementation

Conversation

@mdedetrich

@mdedetrich Matthew de Detrich (mdedetrich) commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Description

This PR adds the exposed-postgres module which initially contains the hstore implementation, both the Map<String, String?> column type mappings and the dsl for both jdbc and r2dbc.

Detailed description:

  • Why: Currently exposed provides a json support (which also supports postgres) but an earlier implementation of json like feature (hstore) is missing. This PR adds this functionality
  • What: A new module called exposed-postgres has been made containing the hstore extension. This was intentional and the reasoning behind it is that no other major DB vendor has a map like type (in other words hstore is unique to postgres). Initially when working on it I called the module exposed-postgres-hstore but upon reflection using this strategy would have created an explosion in modules as its implying that each unique feature for each database needs its own module (where as with exposed-postgres, all of the postgres unique database features can be contained there)
  • How: Aside from the reasoning behind the new module name (i.e. exposed-postgres), the actual implementation and DSL was largely based off of the existing postgres-json support. Unlike postgres-json, we didn't use a lowest common denominator of functions that are common with all DB vendors but instead provided full hstore functionality.

On a related note, since we have now a module that is specific for postgres it also opens the capability of filling in gaps where current dsl's only implement lowest common denominator functionality for features that are common amongst all supported database vendors. As an example, currently the exposed-json doesn't support all of postgres's json/jsonb functionality because its not available in other databases, but with a exposed-postgres module you can place those missing functions there i.e. here are the concrete gaps in Postgres's jsonb surface that exposed-json skips (Postgres-only, no MySQL/H2/SQLite/Oracle/SQLServer equivalent):

  • || concat, - / #- delete-by-path (mirrors exactly what we just built for hstore)
  • jsonb_set(), jsonb_insert() — targeted mutation by path
  • @? / @@ jsonpath match operators, jsonb_path_query() family (SQL/JSON path language, Postgres-specific implementation)
  • #> / #>> path-extraction operators (distinct from the ->/->> exposed-json already covers generically)

Type of Change

Please mark the relevant options with an "X":

  • Bug fix
  • New feature
  • Documentation update

Updates/remove existing public API methods:

  • Is breaking change

Affected databases:

  • MariaDB
  • Mysql5
  • Mysql8
  • Oracle
  • Postgres
  • Redshift
  • SqlServer
  • H2
  • SQLite

Checklist

  • Unit tests are in place
  • The build is green (including the Detekt check)
  • All public methods affected by my PR has up to date API docs
  • Documentation for my change is up to date

@mdedetrich
Matthew de Detrich (mdedetrich) force-pushed the add-exposed-postgres-with-initial-hstore-implementation branch from dd2c61e to e08c853 Compare September 5, 2026 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant