-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
caveats: - anorm didn't support returning rows for batch queries, so it's monkey-patched in into the `anorm` package - zio-jdbc cannot express batch updates at all. For this reason it was necessary to add support for not implementing a repo method for a dblib.
- Loading branch information
1 parent
b01e5cd
commit c377b16
Showing
642 changed files
with
8,177 additions
and
106 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
...norm@jvm213/scripts.GenHardcodedFiles/anorm/testdb/hardcoded/ExecuteReturningSyntax.scala
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,29 @@ | ||
/** | ||
* File automatically generated by `typo` for its own test suite. | ||
* | ||
* IF YOU CHANGE THIS FILE YOUR CHANGES WILL BE OVERWRITTEN | ||
*/ | ||
package anorm | ||
package testdb | ||
package hardcoded | ||
|
||
import java.sql.Connection | ||
import resource.managed | ||
|
||
object ExecuteReturningSyntax { | ||
/* add executeReturning to anorm. it needs to be inside the package, because everything is hidden */ | ||
implicit class Ops(batchSql: BatchSql) { | ||
def executeReturning[T](parser: ResultSetParser[T])(implicit c: Connection): T = | ||
managed(batchSql.getFilledStatement(c, getGeneratedKeys = true))(using StatementResource, statementClassTag).acquireAndGet { ps => | ||
ps.executeBatch() | ||
Sql | ||
.asTry( | ||
parser, | ||
managed(ps.getGeneratedKeys)(using ResultSetResource, resultSetClassTag), | ||
onFirstRow = false, | ||
ColumnAliaser.empty | ||
) | ||
.get | ||
} | ||
} | ||
} |
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
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
29 changes: 29 additions & 0 deletions
29
...-anorm@jvm3/scripts.GenHardcodedFiles/anorm/testdb/hardcoded/ExecuteReturningSyntax.scala
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,29 @@ | ||
/** | ||
* File automatically generated by `typo` for its own test suite. | ||
* | ||
* IF YOU CHANGE THIS FILE YOUR CHANGES WILL BE OVERWRITTEN | ||
*/ | ||
package anorm | ||
package testdb | ||
package hardcoded | ||
|
||
import java.sql.Connection | ||
import resource.managed | ||
|
||
object ExecuteReturningSyntax { | ||
/* add executeReturning to anorm. it needs to be inside the package, because everything is hidden */ | ||
implicit class Ops(batchSql: BatchSql) { | ||
def executeReturning[T](parser: ResultSetParser[T])(implicit c: Connection): T = | ||
managed(batchSql.getFilledStatement(c, getGeneratedKeys = true))(using StatementResource, statementClassTag).acquireAndGet { ps => | ||
ps.executeBatch() | ||
Sql | ||
.asTry( | ||
parser, | ||
managed(ps.getGeneratedKeys)(using ResultSetResource, resultSetClassTag), | ||
onFirstRow = false, | ||
ColumnAliaser.empty | ||
) | ||
.get | ||
} | ||
} | ||
} |
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
Oops, something went wrong.