ownership bugfix and vbump

This commit is contained in:
2020-01-27 09:05:11 +01:00
parent 2386599913
commit 262aacc0a9
4 changed files with 9 additions and 9 deletions

View File

@@ -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

View File

@@ -32,7 +32,7 @@
<p>is a simple high-level wrapper around SQLite3. It doesnt intend
to wrap everything, but it tries to be useful.</p>
<h2>Installation</h2>
<pre><code class="language-clojure">(load &quot;https://veitheller.de/git/carpentry/sqlite3@0.0.2&quot;)
<pre><code class="language-clojure">(load &quot;https://veitheller.de/git/carpentry/sqlite3@0.0.3&quot;)
</code></pre>
<h2>Usage</h2>
<p>The module <code>SQLite3</code> provides facilities for opening, closing, and querying

View File

@@ -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))))))

View File

@@ -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;