fix for new version of carp
This commit is contained in:
@@ -6,7 +6,7 @@ everything, but it tries to be useful.
|
||||
## Installation
|
||||
|
||||
```clojure
|
||||
(load "https://veitheller.de/git/carpentry/sqlite3@0.0.4")
|
||||
(load "https://veitheller.de/git/carpentry/sqlite3@0.0.5")
|
||||
```
|
||||
|
||||
## Usage
|
||||
@@ -15,7 +15,7 @@ The module `SQLite3` provides facilities for opening, closing, and querying
|
||||
databases.
|
||||
|
||||
```clojure
|
||||
(load "https://veitheller.de/git/carpentry/sqlite3@0.0.4")
|
||||
(load "https://veitheller.de/git/carpentry/sqlite3@0.0.5")
|
||||
|
||||
; opening DBs can fail, for the purposes of this example we
|
||||
; ignore that
|
||||
|
@@ -9,8 +9,8 @@
|
||||
<body>
|
||||
<div class="content">
|
||||
<div class="logo">
|
||||
<a href="http://github.com/carp-lang/Carp">
|
||||
<img src="logo.png">
|
||||
<a href="">
|
||||
<img src="">
|
||||
</a>
|
||||
<div class="title">
|
||||
sqlite3
|
||||
@@ -32,12 +32,12 @@
|
||||
<p>is a simple high-level wrapper around SQLite3. It doesn’t intend
|
||||
to wrap everything, but it tries to be useful.</p>
|
||||
<h2>Installation</h2>
|
||||
<pre><code class="language-clojure">(load "https://veitheller.de/git/carpentry/sqlite3@0.0.4")
|
||||
<pre><code class="language-clojure">(load "https://veitheller.de/git/carpentry/sqlite3@0.0.5")
|
||||
</code></pre>
|
||||
<h2>Usage</h2>
|
||||
<p>The module <code>SQLite3</code> provides facilities for opening, closing, and querying
|
||||
databases.</p>
|
||||
<pre><code class="language-clojure">(load "https://veitheller.de/git/carpentry/sqlite3@0.0.4")
|
||||
<pre><code class="language-clojure">(load "https://veitheller.de/git/carpentry/sqlite3@0.0.5")
|
||||
|
||||
; opening DBs can fail, for the purposes of this example we
|
||||
; ignore that
|
||||
@@ -70,7 +70,7 @@ combinators!</p>
|
||||
</h3>
|
||||
</a>
|
||||
<div class="description">
|
||||
doc-stub
|
||||
meta-stub
|
||||
</div>
|
||||
<p class="sig">
|
||||
a
|
||||
@@ -101,11 +101,7 @@ anything.</p>
|
||||
|
||||
</span>
|
||||
<p class="doc">
|
||||
<p>represent all the SQLite types we can represent.</p>
|
||||
<p>The constructors are <code>Null</code>, <code>Integer</code>, <code>Floating</code>, <code>Text</code>, and <code>Blob</code>. Most
|
||||
primitive Carp types can be casted to appropriate SQLite types by using the
|
||||
<code>to-sqlite3</code> interface.</p>
|
||||
|
||||
|
||||
</p>
|
||||
</div>
|
||||
<div class="binder">
|
||||
@@ -159,7 +155,7 @@ primitive Carp types can be casted to appropriate SQLite types by using the
|
||||
defn
|
||||
</div>
|
||||
<p class="sig">
|
||||
(Fn [(Ref SQLite a), (Ref String b), (Ref (Array Type) c)] (Result (Array (Array Type)) String))
|
||||
(Fn [(Ref SQLite a), (Ref String b), (Ref (Array SQLite3.Type) c)] (Result (Array (Array SQLite3.Type)) String))
|
||||
</p>
|
||||
<pre class="args">
|
||||
(query db s p)
|
||||
|
30
sqlite3.carp
30
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.4\")
|
||||
(load \"https://veitheller.de/git/carpentry/sqlite3@0.0.5\")
|
||||
```
|
||||
|
||||
## Usage
|
||||
@@ -16,7 +16,7 @@ The module `SQLite3` provides facilities for opening, closing, and querying
|
||||
databases.
|
||||
|
||||
```clojure
|
||||
(load \"https://veitheller.de/git/carpentry/sqlite3@0.0.4\")
|
||||
(load \"https://veitheller.de/git/carpentry/sqlite3@0.0.5\")
|
||||
|
||||
; opening DBs can fail, for the purposes of this example we
|
||||
; ignore that
|
||||
@@ -177,29 +177,29 @@ If it fails, we return an error message using `Result.Error`.")
|
||||
(doc close "closes a database.")
|
||||
(register close (Fn [SQLite] ()) "SQLite3_close_c"))
|
||||
|
||||
(definterface to-sqlite3 (Fn [a] SQLIte3.Type))
|
||||
(definterface to-sqlite3 (Fn [a] SQLite3.Type))
|
||||
|
||||
(defmodule Bool
|
||||
(implements to-sqlite3 to-sqlite3)
|
||||
(defn to-sqlite3 [b] (SQLite3.Type.Integer (if b 1 0))))
|
||||
(defn to-sqlite3 [b] (SQLite3.Type.Integer (if b 1 0)))
|
||||
(implements to-sqlite3 Bool.to-sqlite3))
|
||||
|
||||
(defmodule Int
|
||||
(implements to-sqlite3 to-sqlite3)
|
||||
(defn to-sqlite3 [i] (SQLite3.Type.Integer i)))
|
||||
(defn to-sqlite3 [i] (SQLite3.Type.Integer i))
|
||||
(implements to-sqlite3 Int.to-sqlite3))
|
||||
|
||||
(defmodule Long
|
||||
(implements to-sqlite3 to-sqlite3)
|
||||
(defn to-sqlite3 [l] (SQLite3.Type.Integer (to-int (the Long l)))))
|
||||
(defn to-sqlite3 [l] (SQLite3.Type.Integer (to-int (the Long l))))
|
||||
(implements to-sqlite3 Long.to-sqlite3))
|
||||
|
||||
(defmodule Float
|
||||
(implements to-sqlite3 to-sqlite3)
|
||||
(defn to-sqlite3 [f] (SQLite3.Type.Floating (Double.from-float f))))
|
||||
(defn to-sqlite3 [f] (SQLite3.Type.Floating (Double.from-float f)))
|
||||
(implements to-sqlite3 Float.to-sqlite3))
|
||||
|
||||
(defmodule Double
|
||||
(implements to-sqlite3 to-sqlite3)
|
||||
(defn to-sqlite3 [d] (SQLite3.Type.Floating d)))
|
||||
(defn to-sqlite3 [d] (SQLite3.Type.Floating d))
|
||||
(implements to-sqlite3 Double.to-sqlite3))
|
||||
|
||||
(defmodule String
|
||||
(implements to-sqlite3 to-sqlite3)
|
||||
(defn to-sqlite3 [s] (SQLite3.Type.Text s)))
|
||||
(defn to-sqlite3 [s] (SQLite3.Type.Text s))
|
||||
(implements to-sqlite3 String.to-sqlite3))
|
||||
|
||||
|
Reference in New Issue
Block a user