Skip to content

Commit

Permalink
feat: add toColumn infix function
Browse files Browse the repository at this point in the history
  • Loading branch information
magonxesp committed Sep 30, 2024
1 parent 4478058 commit 9ea6a98
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package io.github.magonxesp.criteria.infrastructure.exposed

import org.jetbrains.exposed.sql.Column

infix fun String.toColumn(column: Column<*>): Pair<String, Column<Any>> = Pair(this, column as Column<Any>)
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ abstract class CriteriaExposedQueryAdapterTest : IntegrationTestCase() {
abstract fun setupDatabaseConnection(): Database

private val columns = mapOf(
BookTable::id.name to BookTable.id as Column<Any>,
BookTable::title.name to BookTable.title as Column<Any>,
BookTable::author.name to BookTable.author as Column<Any>,
BookTable::stock.name to BookTable.stock as Column<Any>,
BookTable::numericalId.name to BookTable.numericalId as Column<Any>,
BookTable::id.name toColumn BookTable.id,
BookTable::title.name toColumn BookTable.title,
BookTable::author.name toColumn BookTable.author,
BookTable::stock.name toColumn BookTable.stock,
BookTable::numericalId.name toColumn BookTable.numericalId,
)

@Test
Expand Down

0 comments on commit 9ea6a98

Please sign in to comment.