Skip to content

feat: extract sql-module - #4065

Draft
thoniTUB wants to merge 79 commits into
developfrom
feat/sql-module
Draft

thoniTUB wants to merge 79 commits into
developfrom
feat/sql-module

Conversation

@thoniTUB

@thoniTUB thoniTUB commented Oct 1, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

thoniTUB and others added 30 commits September 23, 2026 07:24
Co-authored-by: Codex GPT-5 <codex@openai.com>
Co-authored-by: Codex GPT-5 <codex@openai.com>
Co-authored-by: Codex GPT-5 <codex@openai.com>
Co-authored-by: Codex GPT-5 <codex@openai.com>
Co-authored-by: Codex GPT-5 <codex@openai.com>
Remove the unused SQL function provider from union-step construction so the
compiler IR no longer carries a false runtime dependency. Also replace
Javadoc-only links to select DTOs with IR terminology.

Co-authored-by: Codex GPT-5 <codex@openai.com>
Make dialect-specific final select aggregation part of CompilerDialect and
bridge the legacy backend provider to the new contract. Add jOOQ to the
connector module so compiler IR can depend directly on SQL expression types.

Co-authored-by: Codex GPT-5 <codex@openai.com>
Add a self-contained compiled query with an ordered physical column layout so
backends can execute SQL and correlate results without compiler-owned result
processing. Replace presentation metadata in resolved result columns with stable
output identifiers and validate identifiers and SQL aliases for uniqueness.

Co-authored-by: Codex GPT-5 <codex@openai.com>
Add a backend-neutral SqlCompiler that compiles a resolved query for an
explicitly selected dialect. Remove execution routing from ResolvedQuery so
dataset revisions and datasource selection remain backend responsibilities.

Co-authored-by: Codex GPT-5 <codex@openai.com>
Move the qualification and select intermediate-representation contracts into
sql-connector so compiler transformations no longer depend on backend-owned
types. Update the legacy backend to consume the connector contracts.

Co-authored-by: Codex GPT-5.6-sol <codex@openai.com>
Move the field-backed, extracting, and existence select representations into
the connector-owned compiler IR. Use plain Java implementations, preserve the
legacy equality behavior, and cover the relocated transformations with tests.

Co-authored-by: Codex GPT-5.6-sol <codex@openai.com>
Move the two-column date range representation and field qualification utility
into the connector-owned compiler IR. Replace Lombok-generated accessors with
plain Java and cover qualification, aliasing, and coalescing behavior with tests.

Co-authored-by: Codex GPT-5.6-sol <codex@openai.com>
Move shared compiler aliases and plain and stratified ID-column representations
into the connector-owned IR. Normalize backend resolution enums before crossing
the boundary and cover aliasing, qualification, and stratification with tests.

Co-authored-by: Codex GPT-5.6-sol <codex@openai.com>
Move the Selects aggregate and its pure transformations into the
connector-owned IR while preserving its Lombok value and builder API. Keep
dialect-aware final projection rendering in the backend transformer and cover
the moved aggregate with focused tests.

Co-authored-by: Codex GPT-5.6-sol <codex@openai.com>
Move dialect-aware Selects rendering into the connector compiler. Expose
physical date-range rendering through CompilerDialect, bridge the legacy
function provider, and cover aggregated and individual validity-date modes.

Co-authored-by: Codex GPT-5.6-sol <codex@openai.com>
Move QueryStep into the connector-owned IR and rewire legacy compiler
consumers. Replace the backend-specific table-export flag with an explicit
projection mode and cover qualification, unions, and final rendering modes.

Co-authored-by: Codex GPT-5.6-sol <codex@openai.com>
Move recursive CTE, grouping, and union rendering into the connector compiler.
Keep backend integration limited to constructing and invoking the renderer, and
cover predecessor and union rendering with focused connector tests.

Co-authored-by: Codex GPT-5.6-sol <codex@openai.com>
Move join modes, table joining, ID coalescing, and select merging into the
connector compiler IR. Rename the remaining backend helper to QueryStepComposer
and cover portable join construction with focused connector tests.

Co-authored-by: Codex GPT-5.6-sol <codex@openai.com>
Move DateAggregationDates into the connector compiler IR as a qualifiable value
object. Rewire the legacy aggregation pipeline and cover filtering, query-step
qualification, selected bounds, and empty inputs with focused tests.

Co-authored-by: Codex GPT-5.6-sol <codex@openai.com>
Move the pure date-propagation vocabulary into the dependency-free shared model
so the legacy and SQL query models use one enum. Keep CDateSet operations in the
backend DateAggregator and preserve their behavior with focused tests.

Co-authored-by: Codex GPT-5.6-sol <codex@openai.com>
Move CTE step and table-resolution structures into the connector compiler IR.
Decouple CTE name mapping from the backend name generator through a naming
function and cover predecessor, naming, and table resolution behavior.

Co-authored-by: Codex GPT-5.6-sol <codex@openai.com>
Move stateful SQL alias and CTE naming into the connector compiler. Add stable
technical names to resolved selects and filters, expose typed naming methods,
and retain explicit legacy bridges until backend conversion uses this model.

Co-authored-by: Codex GPT-5.6-sol <codex@openai.com>
Move composable WHERE conditions and phase-specific clause grouping out of the
legacy backend. Keep backend conversion on connector-owned IR and cover logical
composition, inversion, flag matching, and clause grouping.

Co-authored-by: Codex GPT-5.6-sol <codex@openai.com>
Move string membership rendering into the connector's condition IR. Remove the
unused legacy dialect indirection, align the internal name with the resolved
model, and cover single, multiple, empty, null, and negated selections.

Co-authored-by: Codex GPT-5.6-sol <codex@openai.com>
Centralize strict date-range overlap rendering in the connector's condition IR.
Remove identical HANA and ClickHouse dialect hooks, migrate legacy callers, and
cover the exclusive-end overlap expression.

Co-authored-by: Codex GPT-5.6-sol <codex@openai.com>
Centralize inclusive-bound rendering in the connector's condition IR.
Introduce a shared, order-validating range contract implemented by both
resolved and legacy models, then remove the remaining backend condition utility.

Co-authored-by: Codex GPT-5.6-sol <codex@openai.com>
Replace the type-named backend range condition wrappers with one explicit
compatibility adapter. Keep the wildcard bridge isolated until backend
conversion produces connector model ranges directly.

Co-authored-by: Codex GPT-5.6-sol <codex@openai.com>
Move dialect-independent field expressions into connector IR and expose date
sentinels through CompilerDialect. Replace DateAggregationContext's broad
backend conversion state with the narrow compiler dialect dependency.

Co-authored-by: Codex GPT-5.6-sol <codex@openai.com>
Move the framework-neutral interval-packing transformation and its CTE graph
into the connector IR. Remove the unused PostgreSQL strategy and obsolete
dialect plumbing now that HANA and ClickHouse share the ANSI implementation.

Cover both multi-step and single-column CTE mappings and fix the latter to
reference the root table when intermediate steps are omitted.

Co-authored-by: Codex GPT-5.6-sol <codex@openai.com>
Move the date aggregation and inversion CTE graph into the connector IR and
expose it through a framework-neutral DateAggregationCompiler. Retain a small
legacy backend adapter that supplies dialect and naming dependencies.

Add direct connector tests for merge, intersect, inversion, empty date input,
and unsupported aggregation actions.

Co-authored-by: Codex GPT-5.6-sol <codex@openai.com>
thoniTUB and others added 30 commits September 23, 2026 09:03
Compile connector CTE phases and predecessor wiring from a SQL-resolved
pipeline input. Reduce the legacy concept converter to an input adapter and
remove its backend-specific pipeline state and phase classes.

Co-authored-by: Codex GPT-5.6-sol <codex@openai.com>
Let the connector compile the final concept CTE and its optional interval
select branch from SQL-resolved input. Keep the legacy backend responsible
for converting concept selects and remove its concept-branch adapter.

Co-authored-by: Codex GPT-5.6-sol <codex@openai.com>
Compile arbitrary interval-packed select projections in the connector and
expose single-column range expansion as a compiler dialect capability. Keep
the backend dialect as a temporary delegate to its existing implementation.

Co-authored-by: Codex GPT-5.6-sol <codex@openai.com>
Move auxiliary CTE planning and arbitrary date-range packing into the SQL
connector. Return neutral preparation IR so the legacy adapter only creates
the select or filter aggregation expression.

Co-authored-by: Codex GPT-5.6-sol <codex@openai.com>
Move connector and final-concept CTE graph planning into the SQL connector.
Keep the legacy table path responsible for model inspection and attaching
backend-specific connector metadata.

Co-authored-by: Codex GPT-5.6-sol <codex@openai.com>
Assemble preprocessing inputs, event-date selects, and additional predecessors
inside the SQL connector. Carry the generated connector name with its CTE plan
so the legacy adapter only retains backend connector metadata.

Co-authored-by: Codex GPT-5.6-sol <codex@openai.com>
Expose connector-owned SqlTables directly to legacy filter conversion and
shared aggregation helpers. Keep ConnectorSqlTables limited to select paths
that still require backend Connector metadata.

Co-authored-by: Codex GPT-5.6-sol <codex@openai.com>
Carry physical connector tables through CTE planning and preprocessing so
SQL generation preserves schema-qualified names from resolved models. Keep
the legacy string planning entry point for the backend adapter, and derive
the entity table from its resolved primary-ID column.

Co-authored-by: Codex GPT-5.6-sol <codex@openai.com>
Return complete query steps from connector CTE compilation instead of
exposing mutable builders across method boundaries. Let concept and date
aggregation stages own their CTE metadata and predecessor relationships,
and keep individual connector stages package-private.

Co-authored-by: Codex GPT-5.6-sol <codex@openai.com>
Convert built-in resolved conditions into compiler IR through the connector's
runtime dispatcher and allow extensions to contribute converters for their
own condition types. Expose regular-expression matching as a compiler dialect
capability while preserving the legacy backend dialect implementations.
Mark the prefix-range model as deprecated because matching-statistics
expression generation does not support it.

Co-authored-by: Codex GPT-5.6-sol <codex@openai.com>
Convert resolved string-value and numeric-range filters into event-level
connector predicates. Preserve zero-based substring semantics when building
SQL expressions and provide the compiler context and dispatcher boundary for
extension-defined filter converters. Document the preprocessing, event, and
post-aggregation condition buckets consumed by the connector pipeline.

Co-authored-by: Codex GPT-5.6-sol <codex@openai.com>
Convert resolved flag and date-distance filters into event-level connector
predicates. Keep range and flag semantics in the connector while delegating
database-specific date-distance expressions to the compiler dialect and
preserving the legacy backend adapter.

Co-authored-by: Codex GPT-5.6-sol <codex@openai.com>
Co-authored-by: Codex GPT-6 <codex@openai.com>
Preserve develop SQL semantics for subtraction, distinct keys, numeric types, and date ranges. Record local compatibility coverage and the remaining extraction plan.

Co-authored-by: Codex GPT-6 <codex@openai.com>
Co-authored-by: Codex GPT-6 <codex@openai.com>
Co-authored-by: Codex GPT-6 <codex@openai.com>
Co-authored-by: Codex GPT-6 <codex@openai.com>
Co-authored-by: Codex GPT-6 <codex@openai.com>
Co-authored-by: Codex GPT-6 <codex@openai.com>
Co-authored-by: Codex GPT-6 <codex@openai.com>
Co-authored-by: Codex GPT-6 <codex@openai.com>
Co-authored-by: Codex GPT-5.6-sol <codex@openai.com>
Co-authored-by: Codex GPT-6 <codex@openai.com>
Co-authored-by: Codex GPT-6 <codex@openai.com>
Co-authored-by: Codex GPT-6 <codex@openai.com>
Co-authored-by: Codex GPT-6 <codex@openai.com>
Co-authored-by: Codex GPT-6 <codex@openai.com>
Propagate stratified IDs and bounds through select and filter conversion. Use inclusive stratification bounds for form date-distance operations and verify entity-date lower-bound intersection.

Co-authored-by: Codex GPT-6 <codex@openai.com>

This branch has not been deployed

No deployments
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