1 Commits
0.0.4 ... 0.0.5

Author SHA1 Message Date
1b87e7fec1 fix for new version of carp 2021-01-19 12:16:34 +01:00
3 changed files with 24 additions and 28 deletions

View File

@@ -6,7 +6,7 @@ everything, but it tries to be useful.
## Installation ## Installation
```clojure ```clojure
(load "https://veitheller.de/git/carpentry/sqlite3@0.0.4") (load "https://veitheller.de/git/carpentry/sqlite3@0.0.5")
``` ```
## Usage ## Usage
@@ -15,7 +15,7 @@ The module `SQLite3` provides facilities for opening, closing, and querying
databases. databases.
```clojure ```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 ; opening DBs can fail, for the purposes of this example we
; ignore that ; ignore that

View File

@@ -9,8 +9,8 @@
<body> <body>
<div class="content"> <div class="content">
<div class="logo"> <div class="logo">
<a href="http://github.com/carp-lang/Carp"> <a href="">
<img src="logo.png"> <img src="">
</a> </a>
<div class="title"> <div class="title">
sqlite3 sqlite3
@@ -32,12 +32,12 @@
<p>is a simple high-level wrapper around SQLite3. It doesnt intend <p>is a simple high-level wrapper around SQLite3. It doesnt intend
to wrap everything, but it tries to be useful.</p> to wrap everything, but it tries to be useful.</p>
<h2>Installation</h2> <h2>Installation</h2>
<pre><code class="language-clojure">(load &quot;https://veitheller.de/git/carpentry/sqlite3@0.0.4&quot;) <pre><code class="language-clojure">(load &quot;https://veitheller.de/git/carpentry/sqlite3@0.0.5&quot;)
</code></pre> </code></pre>
<h2>Usage</h2> <h2>Usage</h2>
<p>The module <code>SQLite3</code> provides facilities for opening, closing, and querying <p>The module <code>SQLite3</code> provides facilities for opening, closing, and querying
databases.</p> databases.</p>
<pre><code class="language-clojure">(load &quot;https://veitheller.de/git/carpentry/sqlite3@0.0.4&quot;) <pre><code class="language-clojure">(load &quot;https://veitheller.de/git/carpentry/sqlite3@0.0.5&quot;)
; opening DBs can fail, for the purposes of this example we ; opening DBs can fail, for the purposes of this example we
; ignore that ; ignore that
@@ -70,7 +70,7 @@ combinators!</p>
</h3> </h3>
</a> </a>
<div class="description"> <div class="description">
doc-stub meta-stub
</div> </div>
<p class="sig"> <p class="sig">
a a
@@ -101,11 +101,7 @@ anything.</p>
</span> </span>
<p class="doc"> <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> </p>
</div> </div>
<div class="binder"> <div class="binder">
@@ -159,7 +155,7 @@ primitive Carp types can be casted to appropriate SQLite types by using the
defn defn
</div> </div>
<p class="sig"> <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> </p>
<pre class="args"> <pre class="args">
(query db s p) (query db s p)

View File

@@ -7,7 +7,7 @@ to wrap everything, but it tries to be useful.
## Installation ## Installation
```clojure ```clojure
(load \"https://veitheller.de/git/carpentry/sqlite3@0.0.4\") (load \"https://veitheller.de/git/carpentry/sqlite3@0.0.5\")
``` ```
## Usage ## Usage
@@ -16,7 +16,7 @@ The module `SQLite3` provides facilities for opening, closing, and querying
databases. databases.
```clojure ```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 ; opening DBs can fail, for the purposes of this example we
; ignore that ; ignore that
@@ -177,29 +177,29 @@ If it fails, we return an error message using `Result.Error`.")
(doc close "closes a database.") (doc close "closes a database.")
(register close (Fn [SQLite] ()) "SQLite3_close_c")) (register close (Fn [SQLite] ()) "SQLite3_close_c"))
(definterface to-sqlite3 (Fn [a] SQLIte3.Type)) (definterface to-sqlite3 (Fn [a] SQLite3.Type))
(defmodule Bool (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 (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 (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 (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 (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 (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))