Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 21, 2025

Generalizes API signatures to accept AbstractQuery<*> instead of the more specific Query type where Query-specific methods are not needed.

Changes

Core module (DatabaseClient.kt)

  • Query execution methods: executeQuery(), executeQueryForList(), executeBatchQuery()
  • Extension functions: getFieldExpressionSet(), getFieldExpressionSetWithTransaction(), Row.toExposedResultRow()

CRUD module (Queries.kt)

  • Return types in select() and selectBatch() where receiver is ColumnSet/FieldSet
  • Preserved Query.() -> Query for builder lambdas requiring Query-specific methods like where()

CRUD-with-mapper module (QueriesWithMapper.kt)

  • Query parameters in executeQueryWithMapper(), executeVertxSqlClientRowQueryWithMapper()
  • Preserved Query.() -> Query for selectWithMapper() builder lambda

Example

// Before: only accepts Query
suspend fun executeQuery(query: Query): RowSet<ResultRow>

// After: accepts any AbstractQuery subtype
suspend fun executeQuery(query: AbstractQuery<*>): RowSet<ResultRow>

// Builder lambdas requiring Query methods remain typed as Query
suspend fun selectSingleColumn(
    column: Column<T>, 
    buildQuery: Query.() -> Query  // Needs where(), groupBy(), etc.
)

Since Query extends AbstractQuery, this change is backward compatible while enabling the API to work with all query types in Exposed's hierarchy.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • www.example.com
    • Triggering command: /opt/oracle/product/26ai/dbhomeFree/bin/oracle oracleFREE (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq))) (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>Try replacing Query with AbstractQuery as much as possible in the APIs</issue_title>
<issue_description></issue_description>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Co-authored-by: ShreckYe <27768951+ShreckYe@users.noreply.github.com>
@sonarqubecloud
Copy link

Co-authored-by: ShreckYe <27768951+ShreckYe@users.noreply.github.com>
Copilot AI changed the title [WIP] Try replacing Query with AbstractQuery in the APIs Replace Query with AbstractQuery in public APIs Nov 21, 2025
Copilot AI requested a review from ShreckYe November 21, 2025 19:50
Copilot finished work on behalf of ShreckYe November 21, 2025 19:50
@ShreckYe ShreckYe marked this pull request as ready for review November 22, 2025 10:36
…IntelliJ IDEA

Confirmed that all the remaining `Query` usages that are not replaced can not be replaced.
@sonarqubecloud
Copy link

@ShreckYe
Copy link
Member

Postponed to merge as part of #30.

@ShreckYe ShreckYe added this to the 0.7.0 milestone Nov 23, 2025
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.

Try replacing Query with AbstractQuery as much as possible in the APIs

2 participants