WIP on execution / SQLite integration tests

This commit is contained in:
2025-02-23 22:11:06 -05:00
parent 93f4700613
commit 7f3392f004
16 changed files with 583 additions and 57 deletions

29
src/main/kotlin/Count.kt Normal file
View File

@@ -0,0 +1,29 @@
package solutions.bitbadger.documents
import solutions.bitbadger.documents.query.Count
import java.sql.Connection
/**
* Functions to count documents
*/
object Count {
/**
* Count all documents in the table
*
* @param tableName The name of the table in which documents should be counted
* @param conn The connection over which documents should be counted
* @return A count of the documents in the table
*/
fun all(tableName: String, conn: Connection) =
conn.customScalar(Count.all(tableName), mapFunc = Results::toCount)
/**
* Count all documents in the table
*
* @param tableName The name of the table in which documents should be counted
* @return A count of the documents in the table
*/
fun all(tableName: String) =
Configuration.dbConn().use { all(tableName, it) }
}