Introduction to Polygon SQL Framework

Last modified 24 Jul 2026 14:23 UTC
Since 4.11
This functionality is available since version 4.11.

The SQL Framework is a ConnId connector framework, designed to provide a flexible and extensible base for connecting to any relational SQL database (PostgreSQL, MySQL, Oracle, SQLite, H2) using JDBC with declarative Groovy DSLs for schema mapping and operation customization.

SQL Framework is still under development, so not all listed functionality is fully implemented yet, and some concepts may change during development.

What is the Polygon SQL Framework

The SQL Framework in midPoint is a low-code scaffolding layer that lets you build a JDBC-based connector for any relational database without writing Java boilerplate. It sits above the generic ConnId infrastructure and below any concrete database-specific customization.

Goal How the framework achieves it

Rapid database connectivity

You supply a JDBC connection (URL, credentials, dialect) and a small set of Groovy scripts that map relevant SQL tables to ConnId object classes with attribute definitions. The framework generates the necessary ConnId-compatible connector code automatically.

Automatic schema discovery

The framework inspects the database via JDBC metadata to discover all tables and columns, then correlates them with user-defined Groovy scripts. No manual schema registration is required.

SQL dialect abstraction

The framework uses QueryDSL SQL templates to abstract away dialect-specific SQL syntax (e.g., RETURNING clause in PostgreSQL, FETCH FIRST in Oracle, pagination in SQLite) across PostgreSQL, MySQL, Oracle, SQLite, and H2.

Uniform ConnId contract

The generated connector conforms to the ConnId SPI, so midPoint treats it exactly like any other ConnId connector (calls create, update, delete, search, and sync). This keeps the provisioning engine unchanged regardless of the underlying database.

Groovy-driven customization

New tables can be mapped by writing simple Groovy scripts that describe table-to-object-class mappings, column-to-attribute mappings, and custom operation handlers. No Java coding is required unless you need behavior not covered by the DSL.

A SQL Framework connector in midPoint acts as a translation layer between ConnId operations and actual SQL database tables. When midPoint initiates a provisioning operation (create, update, delete, read, or search), the connector:

  1. Maps the ConnId object model to the corresponding SQL table and columns defined in Groovy schema scripts.

  2. Generates the appropriate SQL query (SELECT for read/search, INSERT for create, UPDATE for update, DELETE for delete, SELECT …​ WHERE syncColumn > token for sync) using QueryDSL SQL templates tailored to the target dialect.

  3. Sends that query to the configured database via a HikariCP-managed JDBC connection pool, handling authentication and connection lifecycle.

  4. Processes the results, converting SQL row data back into the ConnId object model and propagating status or error information to the provisioning workflow.

Was this page helpful?
YES NO
Thanks for your feedback