mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2025-02-22 14:33:06 +01:00
Don't call findByPrimaryKeys if ids is empty (#4074)
This commit is contained in:
parent
bce58ba33d
commit
3991789129
1 changed files with 6 additions and 2 deletions
|
@ -42,8 +42,12 @@ abstract class CRUDAction[T, PrimaryKeyType](implicit
|
|||
|
||||
protected def findByPrimaryKeysAction(ids: Vector[
|
||||
PrimaryKeyType]): DBIOAction[Vector[T], NoStream, Effect.Read] = {
|
||||
findByPrimaryKeys(ids).result
|
||||
.map(_.toVector)
|
||||
if (ids.isEmpty) {
|
||||
DBIO.successful(Vector.empty)
|
||||
} else {
|
||||
findByPrimaryKeys(ids).result
|
||||
.map(_.toVector)
|
||||
}
|
||||
}
|
||||
|
||||
def findByPrimaryKeyAction(
|
||||
|
|
Loading…
Add table
Reference in a new issue