Commit 10c21aa3 authored by -urso-'s avatar -urso-

added example page "Sequences"

darcs-hash:4ec9a35f8bf79f8f0407d83b904eb24eec53eef9
parent dc16db92
<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>BDB</title>
<link rel="stylesheet" type="text/css" href="../style.css"/>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
</head>
<body>
<div class="header">
<h1>BDB</h1>
<h2>Berkeley DB CFFI bindings</h2>
</div>
<h3>Example Usage (Sequences)</h3>
<pre>
CL-USER&gt; (asdf:oos 'asdf:load-op :bdb-playground)
NIL
CL-USER&gt; (in-package :bdb-ext-playground)
#&lt;PACKAGE "BDB-EXT-PLAYGROUND"&gt;
BDB-EXT-PLAYGROUND&gt; (setq *env* (db-env-open "/home/main/tdb"
:init-txn t
:init-log t
:init-lock t
:init-mpool t
:create t
:buf-reader #'cbuf-reader
:buf-writer #'cbuf-writer))
#&lt;BDB::DB-EXT-ENV {AC56201}&gt;
BDB-EXT-PLAYGROUND&gt; (setq *db* (db-open "test.db" :env *env* :auto-commit t :create t))
#&lt;BDB::DB-EXT {ADFAE81}&gt;
BDB-EXT-PLAYGROUND&gt; (setq *sequ* (db-sequ-open *db* 'sequ1))
; Evaluation aborted | comment: cause key 'sequ1 doesn't exist yet
BDB-EXT-PLAYGROUND&gt; (setq *sequ* (db-sequ-open *db* 'sequ1 :create t))
#&lt;BDB::DB-SEQUENCE-TXN {B5C3841}&gt;
BDB-EXT-PLAYGROUND&gt; (db-sequ-get *sequ*)
0
BDB-EXT-PLAYGROUND&gt; (db-sequ-get *sequ*)
1
BDB-EXT-PLAYGROUND&gt; (db-sequ-get *sequ*)
2
BDB-EXT-PLAYGROUND&gt; (db-sequ-get *sequ*)
3
BDB-EXT-PLAYGROUND&gt; (db-sequ-get *sequ*)
4
BDB-EXT-PLAYGROUND&gt; (db-sequ-get *sequ*)
5
BDB-EXT-PLAYGROUND&gt; (db-sequ-get *sequ*)
6
BDB-EXT-PLAYGROUND&gt; (db-sequ-get *sequ*)
7
BDB-EXT-PLAYGROUND&gt; (db-sequ-get *sequ*)
8
BDB-EXT-PLAYGROUND&gt; (db-sequ-get *sequ* :delta 5)
9
BDB-EXT-PLAYGROUND&gt; (db-sequ-get *sequ* :delta 5)
14
BDB-EXT-PLAYGROUND&gt; (db-sequ-get *sequ* :delta 5)
19
BDB-EXT-PLAYGROUND&gt; (db-sequ-get *sequ* :delta 5)
24
BDB-EXT-PLAYGROUND&gt; (db-sequ-close *sequ*)
T
BDB-EXT-PLAYGROUND&gt; (db-close *db*)
T
BDB-EXT-PLAYGROUND&gt; (db-env-close *env*)
NIL
BDB-EXT-PLAYGROUND&gt; ;;bye bye
</pre>
<p> </p>
<div class="footer">
<a href="mailto:-urso-@web.de">Email</a>
</div>
<div class="check">
<a href="http://validator.w3.org/check/referer"> Valid XHTML 1.0 Strict</a>
</div>
</body>
</html>
......@@ -148,6 +148,7 @@
<li><a href="examples/secondary.html">Secondary Databases</a></li>
<li><a href="examples/txn.html">Transactions</a></li>
<li><a href="examples/ext.html">DB-Ext Test</a></li>
<li><a href="examples/sequence.html">Sequences</a></li>
</ol>
<h3>Mailing Lists</h3>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment