Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix DEFAULT in binding Add test for PostgreSQL Spotless Move mixin to sqldelight Use mixin instead Don't add DEFAULT bindings to query Fix DEFAULT in binding * Remove isDefault api * Fix grammar * Add mysql async test * Add postgresql async test * Fix wildards * Fix code style * Add default to mysql too * Downgrade r2dbc spi due binary incompatible with drivers Fix docker test dependencies * Fix DEFAULT in binding Add test for PostgreSQL Spotless Move mixin to sqldelight Use mixin instead Don't add DEFAULT bindings to query Fix DEFAULT in binding * Remove isDefault api * Fix grammar * Add mysql async test * Add postgresql async test * Fix wildards * Fix code style * Add default to mysql too * Downgrade r2dbc spi due binary incompatible with drivers Fix docker test dependencies * Remove useless check for default Co-authored-by: hfhbd <hfhbd@users.noreply.github.com>
- Loading branch information
Showing
30 changed files
with
418 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
.../main/kotlin/app/cash/sqldelight/dialects/postgresql/grammar/mixins/BindParameterMixin.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package app.cash.sqldelight.dialects.postgresql.grammar.mixins | ||
|
||
import app.cash.sqldelight.dialect.grammar.mixins.BindParameterMixin | ||
import com.intellij.lang.ASTNode | ||
|
||
abstract class BindParameterMixin(node: ASTNode) : BindParameterMixin(node) { | ||
override fun replaceWith(isAsync: Boolean, index: Int): String = when { | ||
isAsync -> "$$index" | ||
else -> "?" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
.../dialect/src/main/kotlin/app/cash/sqldelight/dialect/grammar/mixins/BindParameterMixin.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package app.cash.sqldelight.dialect.grammar.mixins | ||
|
||
import com.alecstrong.sql.psi.core.psi.SqlBindParameter | ||
import com.alecstrong.sql.psi.core.psi.SqlCompositeElementImpl | ||
import com.intellij.lang.ASTNode | ||
|
||
abstract class BindParameterMixin(node: ASTNode) : SqlCompositeElementImpl(node), SqlBindParameter { | ||
/** | ||
* Overwrite, if the user provided sql parameter should be overwritten by sqldelight with [replaceWith]. | ||
* | ||
* Some sql dialects support other bind parameter besides `?`, but sqldelight should still replace the | ||
* user provided parameter with [replaceWith] for a homogen generated code. | ||
*/ | ||
open fun replaceWith(isAsync: Boolean, index: Int): String = "?" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
sqldelight-gradle-plugin/src/test/integration-mysql-async/settings.gradle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
apply from: "../settings.gradle" | ||
|
||
rootProject.name = 'sqldelight-mysql-integration' | ||
rootProject.name = 'sqldelight-mysql-integration-async' |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.