Skip to content

Conversation

@bog-walk
Copy link
Member

@bog-walk bog-walk commented Dec 2, 2023

Before:

1. TestTable.slice(TestTable.columnA).select { TestTable.columnA eq 1 }
2. TestTable.slice(TestTable.columnA).select(Op.TRUE)
3. TestTable.slice(TestTable.columnA).selectAll()

4. TestTable.select { TestTable.columnA eq 1 }
5. TestTable.select(Op.TRUE)
6. TestTable.selectAll()

7. TestTable.slice(TestTable.columnA).selectBatched(50) { TestTable.columnA eq 1 }
8. TestTable.slice(TestTable.columnA).selectAllBatched(50)
9. TestTable.selectBatched(50) { TestTable.columnA eq 1 }
10.TestTable.selectAllBatched(50)
        
11. val originalQuery = TestTable.select { TestTable.columnA eq 1 }
12. originalQuery.adjustSlice { slice(TestTable.columnA) }

After:

1. TestTable.select(TestTable.columnA).where { TestTable.columnA eq 1 }
2. TestTable.select(TestTable.columnA).where(Op.TRUE)
3. TestTable.select(TestTable.columnA)

4. TestTable.selectAll().where { TestTable.columnA eq 1 }
5. TestTable.selectAll().where(Op.TRUE)
6. TestTable.selectAll()

7. TestTable.select(TestTable.columnA).where { TestTable.columnA eq 1 }.fetchBatchedResults(50)
8. TestTable.select(TestTable.columnA).fetchBatchedResults(50)
9. TestTable.selectAll().where { TestTable.columnA eq 1 }.fetchBatchedResults(50)
10. TestTable.selectAll().fetchBatchedResults(50)

11. val originalQuery = TestTable.selectAll().where { TestTable.columnA eq 1 }
12. originalQuery.adjustSelect { select(TestTable.columnA).set }

This PR only affects the src codebase.
All deprecated methods in tests have been left to confirm that all tests still pass.
A PR with all changes applied to the tests will follow this one being merged.

Add temporary Query extension functions for the sole purpose of easing migration
to new design.

Add KDocs.

Refactor all usages in all modules (src directories only).
Edit KDocs.

Edit ReplaceWith to not used named argument.
@bog-walk bog-walk requested review from e5l and joc-a December 2, 2023 05:32
@bog-walk bog-walk changed the title feat!: EXPOSED-65 Design query DSL consistent with SQL language feat: EXPOSED-65 Design query DSL consistent with SQL language Dec 2, 2023
Copy link
Member

@e5l e5l left a comment

Choose a reason for hiding this comment

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

Nice, LGTM

@bog-walk bog-walk merged commit 6d39843 into main Dec 4, 2023
@bog-walk bog-walk deleted the bog-walk/select-dsl-single-step branch December 4, 2023 23:31
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.

4 participants