Skip to content

1.0.4

Choose a tag to compare

@ez-plugins ez-plugins released this 18 Apr 12:44
· 69 commits to main since this release
f30e892

Added

Subquery support (feature/subquery — PR #21)

  • New JoinClause model class representing a JOIN entry targeting either a plain table or a derived-table subquery (INNER / LEFT / RIGHT / CROSS).
  • New ScalarSelectItem model class representing a (SELECT ...) AS alias item in the SELECT clause.
  • Query extended with four new fields: fromSubquery, fromAlias, joins, selectSubqueries.
  • QueryBuilder new fluent methods:
    • whereInSubquery(String column, Query subquery)WHERE col IN (SELECT ...)
    • whereEqualsSubquery(String column, Query subquery)WHERE col = (SELECT ...)
    • whereExistsSubquery(Query subquery)WHERE EXISTS (SELECT ...)
    • whereNotExistsSubquery(Query subquery)WHERE NOT EXISTS (SELECT ...)
    • fromSubquery(Query subquery, String alias)FROM (SELECT ...) AS alias
    • joinSubquery(Query subquery, String alias, String onCondition)INNER JOIN (SELECT ...) AS alias ON ...
    • selectSubquery(Query subquery, String alias) — appends (SELECT ...) AS alias to the SELECT list
  • DeleteBuilder new fluent methods:
    • whereInSubquery(String column, Query subquery)DELETE WHERE col IN (SELECT ...)
    • whereExistsSubquery(Query subquery)DELETE WHERE EXISTS (SELECT ...)
  • Operator enum: added EXISTS_SUBQUERY and NOT_EXISTS_SUBQUERY values.
  • Deterministic subquery parameter ordering contract in AbstractSqlDialect.render(): scalar SELECT subquery params → FROM subquery params → JOIN subquery params → WHERE condition params.
  • New test classes: SubqueryConditionTest, ExistsSubqueryTest, FromSubqueryTest, JoinSubqueryTest, ScalarSelectSubqueryTest, NestedSubqueryParamOrderTest, DeleteSubqueryIntegrationTest.
  • SqlExecutionMatrixTest — real SQLite integration tests covering all builder operations across standard, MySQL, and SQLite dialects.
  • Test dependencies added: junit-jupiter-params 6.0.3, sqlite-jdbc 3.46.1.3 (test scope).

Dialect-aware DELETE rendering (feature/delete-from — PR #20)

  • SqlDialect interface: new renderDelete(Query query) method.
  • AbstractSqlDialect.renderDelete(Query) — standard implementation rendering DELETE FROM <table> WHERE ... with full parameter binding via the shared appendWhereClause helper.
  • AbstractSqlDialect.supportsDeleteLimit() — protected hook; default false. Override to enable dialect-specific DELETE ... LIMIT.
  • MySqlDialect: overrides supportsDeleteLimit()true.
  • SqliteDialect: overrides supportsDeleteLimit()true.
  • AbstractSqlDialectDeleteTest — new test class covering DELETE rendering, dialect quoting, LIMIT behaviour, and IN-clause placeholder count.

Changed

  • DeleteBuilder.build(SqlDialect) refactored: removed inline SQL string building; now delegates entirely to SqlDialect.renderDelete(Query).
  • AbstractSqlDialect.appendWhereClause() and appendConditionFragment() promoted from private to protected to allow reuse in renderDelete.
  • Condition.matches() updated: guards IN and NOT_IN operators against subquery values (returns false when value is a Query instance, since subqueries cannot be evaluated in-memory).
  • CI: replaced JaCoCo PR-comment reporter (madrapps/jacoco-report) with codecov/codecov-action@v5.

Documentation

  • README updated with subquery usage examples (scalar SELECT, FROM derived table, JOIN subquery, WHERE IN subquery, WHERE EXISTS).
  • README updated with renderDelete documentation and DELETE LIMIT dialect behaviour.
  • README artifact ID corrected.
  • Version bumped to 1.0.4 in pom.xml.