Skip to content

DOPE-263: added with clause - #78

Merged
jansigi merged 12 commits into
mainfrom
feature/dope-263-with-clause
Jul 9, 2025
Merged

DOPE-263: added with clause#78
jansigi merged 12 commits into
mainfrom
feature/dope-263-with-clause

Conversation

@martinagallati

Copy link
Copy Markdown
Contributor

as described in DOPE-285, I know that currently Field type expression can be used in with clauses in dope, even tho thats incorrect syntax in couchbase

# Conflicts:
#	core/src/integrationTest/kotlin/ch/ergon/dope/clauses/SelectQueryIntegrationTest.kt
@martinagallati martinagallati self-assigned this Mar 14, 2025

@jansigi jansigi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not really fond with this approche, i would rather go for:

QueryBuilder()
    .with(
        QueryBuilder().select(...).fro(...) ...      .alias("subquery")
    )
    .select(...)

What do you think?

@martinagallati

Copy link
Copy Markdown
Contributor Author

@jansigi

I am not really fond with this approche, i would rather go for:

QueryBuilder()
    .with(
        QueryBuilder().select(...).fro(...) ...      .alias("subquery")
    )
    .select(...)

What do you think?

Do you mean the order of variable and alias? I did it analogous to the LetClause, and in normal SQL the alias comes first as well, which in my opinion is more intuitive to use if you know the with clause in normal SQL. But if DOPE users do not know SQL then I see your point, then I would change the Let Clause as well.

Comment thread core/src/main/kotlin/ch/ergon/dope/resolvable/clause/ISelectClause.kt Outdated
Comment thread core/src/main/kotlin/ch/ergon/dope/resolvable/clause/ISelectClause.kt Outdated
Comment thread core/src/main/kotlin/ch/ergon/dope/resolvable/clause/model/SelectClause.kt Outdated
Comment thread core/src/main/kotlin/ch/ergon/dope/resolvable/clause/model/SelectClause.kt Outdated
Comment thread core/src/main/kotlin/ch/ergon/dope/resolvable/clause/model/SelectClause.kt Outdated
Comment thread core/src/main/kotlin/ch/ergon/dope/resolvable/clause/model/WithClause.kt Outdated
Comment thread core/src/main/kotlin/ch/ergon/dope/resolvable/clause/model/WithClause.kt Outdated
Comment thread core/src/main/kotlin/ch/ergon/dope/resolvable/clause/model/WithClause.kt Outdated
Comment thread core/src/main/kotlin/ch/ergon/dope/resolvable/clause/model/WithClause.kt Outdated
Comment thread core/src/main/kotlin/ch/ergon/dope/resolvable/clause/model/WithClause.kt Outdated
martinagallati and others added 5 commits April 14, 2025 13:56
# Conflicts:
#	core/src/main/kotlin/ch/ergon/dope/resolvable/clause/ISelectClause.kt
# Conflicts:
#	core/src/integrationTest/kotlin/ch/ergon/dope/clauses/UpdateIntegrationTest.kt
@jansigi
jansigi requested review from jansigi and pgruntz May 16, 2025 08:05
jansigi added 3 commits May 16, 2025 10:07
# Conflicts:
#	core/src/integrationTest/kotlin/ch/ergon/dope/clauses/SelectQueryIntegrationTest.kt
#	crystal-map-connector/src/test/kotlin/ch/ergon/dope/extensions/clause/SelectClauseTest.kt
jansigi added 2 commits July 9, 2025 15:18
# Conflicts:
#	core/src/main/kotlin/ch/ergon/dope/resolvable/clause/ISelectClause.kt
#	core/src/test/kotlin/ch/ergon/dope/buildTest/QueryBuilderTest.kt
#	crystal-map-connector/src/test/kotlin/ch/ergon/dope/extensions/clause/SelectClauseTest.kt
@jansigi
jansigi merged commit d90a888 into main Jul 9, 2025
1 check passed
@jansigi
jansigi deleted the feature/dope-263-with-clause branch July 9, 2025 13:30
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.

3 participants