diff --git a/README.md b/README.md index 5863acf..dd42c80 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ everything, but it tries to be useful. ## Installation ```clojure -(load "https://veitheller.de/git/carpentry/sqlite3@0.0.2") +(load "https://veitheller.de/git/carpentry/sqlite3@0.0.3") ``` ## Usage diff --git a/docs/SQLite3.html b/docs/SQLite3.html index 2d1c289..1b5e035 100644 --- a/docs/SQLite3.html +++ b/docs/SQLite3.html @@ -32,7 +32,7 @@
is a simple high-level wrapper around SQLite3. It doesn’t intend to wrap everything, but it tries to be useful.
(load "https://veitheller.de/git/carpentry/sqlite3@0.0.2")
+(load "https://veitheller.de/git/carpentry/sqlite3@0.0.3")
Usage
The module SQLite3
provides facilities for opening, closing, and querying
diff --git a/sqlite3.carp b/sqlite3.carp
index 065a9a1..8f4891a 100644
--- a/sqlite3.carp
+++ b/sqlite3.carp
@@ -7,7 +7,7 @@ to wrap everything, but it tries to be useful.
## Installation
```clojure
-(load \"https://veitheller.de/git/carpentry/sqlite3@0.0.2\")
+(load \"https://veitheller.de/git/carpentry/sqlite3@0.0.3\")
```
## Usage
@@ -145,7 +145,7 @@ primitive Carp types can be casted to appropriate SQLite types by using the
(register open- (Fn [&SQLite (Ptr Char)] Int) "SQLite3_open_c")
(private exec-)
(hidden exec-)
- (register exec- (Fn [&SQLite (Ptr Char) (Array SQLiteColumn)] SQLiteRes) "SQLite3_exec_c")
+ (register exec- (Fn [&SQLite (Ptr Char) &(Array SQLiteColumn)] SQLiteRes) "SQLite3_exec_c")
(private error-)
(hidden error-)
(register error- (Fn [SQLite] (Ptr Char)) "SQLite3_error")
@@ -165,7 +165,7 @@ If it fails, we return an error message using `Result.Error`.")
If it fails, we return an error message using `Result.Error`.")
(defn query [db s p]
- (let [r (exec- db (cstr s) (Array.copy-map &(fn [x] (Type.to-sqlite3-internal @x)) p))]
+ (let [r (exec- db (cstr s) &(Array.copy-map &(fn [x] (Type.to-sqlite3-internal @x)) p))]
(if (SQLiteRes.ok? &r)
(Result.Success (SQLiteRes.to-array r))
(Result.Error (from-cstr (SQLiteRes.error r))))))
diff --git a/sqlite3_helper.h b/sqlite3_helper.h
index f27a039..b571807 100644
--- a/sqlite3_helper.h
+++ b/sqlite3_helper.h
@@ -218,12 +218,12 @@ static const char* SQLite3_exec_ignore(sqlite3_stmt* s) {
return ret;
}
-const char* SQLite3_bind(sqlite3_stmt* s, Array p) {
+const char* SQLite3_bind(sqlite3_stmt* s, Array* p) {
int res;
const char* err = NULL;
- for (int i = 0; i < p.len; i++) {
- SQLiteColumn val = ((SQLiteColumn*)p.data)[i];
+ for (int i = 0; i < p->len; i++) {
+ SQLiteColumn val = ((SQLiteColumn*)p->data)[i];
switch (val.tag) {
case SQLITE_NULL:
@@ -252,7 +252,7 @@ const char* SQLite3_bind(sqlite3_stmt* s, Array p) {
return err;
}
-SQLiteRes SQLite3_exec_c(SQLite* db, const char* stmt, Array p) {
+SQLiteRes SQLite3_exec_c(SQLite* db, const char* stmt, Array* p) {
sqlite3_stmt* s = NULL;
sqlite3_stmt* n = NULL;
const char* err;