Skip to content

Commit 70cd6c9

Browse files
authored
Merge pull request BRonen#2 from usernamenotavailablepleasechooseanother/master
Fix failing test
2 parents e2bf69e + 3f14a04 commit 70cd6c9

File tree

4 files changed

+5
-8
lines changed

4 files changed

+5
-8
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
# Sqlite Lean4
1+
# SQLite Lean
22

3-
Uses the (amalgamation)[https://sqlite.org/amalgamation.html] of (SQLite)[https://sqlite.org/download.html], which bundles all of SQLite into one .c file for easy compilation.
3+
Uses the [amalgamation](https://sqlite.org/amalgamation.html) of [SQLite](https://sqlite.org/), which bundles all of SQLite into one .c file for easy compilation.

Tests/Sqlite.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ def withTest (test : TestContext → IO Bool) : IO Bool := do
4646
def testInsertData (ctx : TestContext) : IO Bool := do
4747
match ← ctx.conn.prepare "INSERT INTO users (id, name) VALUES (?, ?);" with
4848
| Except.ok cursor =>
49-
cursor.bindInt 1 2 -- TODO: This test fails when set to 2 or 3, but other numbers work???
49+
cursor.bindInt 1 2
5050
cursor.bindText 2 "Jane Doe"
51-
let _ ← cursor.step
51+
let _ ← cursor.step -- This always returns false
5252
return true
5353
| Except.error _ => return false
5454

lakefile.lean

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,13 @@ target sqlite.o pkg : FilePath := do
1313
let sqliteHeaders := pkg.dir / "native"
1414
-- Ensure that both sqlite3.h and sqlite3ext.h are available during compilation
1515
let weakArgs := #["-I", sqliteHeaders.toString]
16-
-- Use configured compiler variable to allow Windows toolchains to choose the proper C compiler
1716
buildO oFile srcJob weakArgs #["-fPIC"] compiler getLeanTrace
1817

1918
target sqliteffi.o pkg : FilePath := do
2019
let oFile := pkg.dir / "native" / "sqliteffi.o"
2120
let srcJob ← inputTextFile <| pkg.dir / "native" / "sqliteffi.c"
2221
let sqliteHeaders := pkg.dir / "native"
2322
let weakArgs := #["-I", (← getLeanIncludeDir).toString, "-I", sqliteHeaders.toString]
24-
-- Use configured compiler variable to allow Windows toolchains to choose the proper C compiler
2523
buildO oFile srcJob weakArgs #["-fPIC"] compiler getLeanTrace
2624

2725
extern_lib libsqlite pkg := do

native/sqliteffi.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,8 @@ lean_obj_res lean_sqlite_cursor_bind_text(b_lean_obj_arg cursor_box, uint32_t co
101101
return lean_io_result_mk_ok(lean_box(0));
102102
}
103103

104-
lean_obj_res lean_sqlite_cursor_bind_int(b_lean_obj_arg cursor_box, uint32_t col, b_lean_obj_arg value_box) {
104+
lean_obj_res lean_sqlite_cursor_bind_int(b_lean_obj_arg cursor_box, uint32_t col, int32_t value) {
105105
sqlite3_stmt* cursor = unbox_cursor(cursor_box);
106-
int32_t value = (int32_t) lean_unbox(value_box);
107106

108107
const int32_t c = sqlite3_bind_int(cursor, col, value);
109108

0 commit comments

Comments
 (0)