Skip to content

Commit

Permalink
Add Language annotations for more pleasant SQL editing (#4602)
Browse files Browse the repository at this point in the history
  • Loading branch information
MariusVolkhart authored Oct 20, 2023
1 parent e40231b commit d57fa4c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import app.cash.sqldelight.db.SqlCursor
import app.cash.sqldelight.db.SqlDriver
import app.cash.sqldelight.db.SqlPreparedStatement
import app.cash.sqldelight.driver.jdbc.ConnectionManager.Transaction
import org.intellij.lang.annotations.Language
import java.math.BigDecimal
import java.sql.Connection
import java.sql.PreparedStatement
Expand Down Expand Up @@ -120,7 +121,7 @@ abstract class JdbcDriver : SqlDriver, ConnectionManager {

override fun execute(
identifier: Int?,
sql: String,
@Language("SQL") sql: String,
parameters: Int,
binders: (SqlPreparedStatement.() -> Unit)?,
): QueryResult<Long> {
Expand All @@ -140,7 +141,7 @@ abstract class JdbcDriver : SqlDriver, ConnectionManager {

override fun <R> executeQuery(
identifier: Int?,
sql: String,
@Language("SQL") sql: String,
mapper: (SqlCursor) -> QueryResult<R>,
parameters: Int,
binders: (SqlPreparedStatement.() -> Unit)?,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import kotlinx.coroutines.Job
import kotlinx.coroutines.launch
import kotlinx.coroutines.reactive.awaitFirstOrNull
import kotlinx.coroutines.reactive.awaitSingle
import org.intellij.lang.annotations.Language
import org.reactivestreams.Publisher
import org.reactivestreams.Subscriber
import org.reactivestreams.Subscription
Expand All @@ -28,7 +29,7 @@ class R2dbcDriver(
) : SqlDriver {
override fun <R> executeQuery(
identifier: Int?,
sql: String,
@Language("SQL") sql: String,
mapper: (SqlCursor) -> QueryResult<R>,
parameters: Int,
binders: (SqlPreparedStatement.() -> Unit)?,
Expand All @@ -52,7 +53,7 @@ class R2dbcDriver(

override fun execute(
identifier: Int?,
sql: String,
@Language("SQL") sql: String,
parameters: Int,
binders: (SqlPreparedStatement.() -> Unit)?,
): QueryResult<Long> {
Expand Down

0 comments on commit d57fa4c

Please sign in to comment.