Add exists tests

This commit is contained in:
2025-02-22 08:43:14 -05:00
parent ee4f25aec0
commit 31817d5cec
2 changed files with 228 additions and 80 deletions

View File

@@ -254,7 +254,7 @@ object Query {
* @param docId The ID of the document (optional, used for type checking)
* @return A query to determine document existence by ID
*/
fun <TKey> byId(tableName: String, docId: TKey?) =
fun <TKey> byId(tableName: String, docId: TKey? = null) =
exists(tableName, Where.byId(docId = docId))
/**
@@ -265,7 +265,7 @@ object Query {
* @param howMatched How fields should be compared (optional, defaults to ALL)
* @return A query to determine document existence for the given fields
*/
fun byFields(tableName: String, fields: Collection<Field<*>>, howMatched: FieldMatch?) =
fun byFields(tableName: String, fields: Collection<Field<*>>, howMatched: FieldMatch? = null) =
exists(tableName, Where.byFields(fields, howMatched))
/**