Add CI/CD configuration and API documentation

This commit is contained in:
2026-07-01 21:40:53 +08:00
commit c590135d68
4168 changed files with 740252 additions and 0 deletions
@@ -0,0 +1,23 @@
import XCTest
import GRDB
class DatabasePoolFunctionTests: GRDBTestCase {
func testFunctionIsSharedBetweenWriterAndReaders() throws {
dbConfiguration.prepareDatabase { db in
db.add(function: DatabaseFunction("function1", argumentCount: 1, pure: true) { (dbValues: [DatabaseValue]) in
return dbValues[0]
})
}
let dbPool = try makeDatabasePool()
try dbPool.write { db in
try db.execute(sql: "CREATE TABLE items (text TEXT)")
try db.execute(sql: "INSERT INTO items (text) VALUES (function1('a'))")
}
try dbPool.read { db in
XCTAssertEqual(try String.fetchOne(db, sql: "SELECT function1(text) FROM items")!, "a")
}
}
}