diff --git a/examples/sequence.html b/examples/sequence.html new file mode 100644 index 0000000000000000000000000000000000000000..7f8f07f6ea391787aa1084e2a354120eaba0375c --- /dev/null +++ b/examples/sequence.html @@ -0,0 +1,83 @@ + + + + + BDB + + + + + +
+

BDB

+

Berkeley DB CFFI bindings

+
+ +

Example Usage (Sequences)

+
+CL-USER> (asdf:oos 'asdf:load-op :bdb-playground)
+NIL
+CL-USER> (in-package :bdb-ext-playground)
+#<PACKAGE "BDB-EXT-PLAYGROUND">
+BDB-EXT-PLAYGROUND> (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))
+#<BDB::DB-EXT-ENV {AC56201}>
+BDB-EXT-PLAYGROUND> (setq *db* (db-open "test.db" :env *env* :auto-commit t :create t))
+#<BDB::DB-EXT {ADFAE81}>
+BDB-EXT-PLAYGROUND> (setq *sequ* (db-sequ-open *db* 'sequ1))
+; Evaluation aborted | comment: cause key 'sequ1 doesn't exist yet
+BDB-EXT-PLAYGROUND> (setq *sequ* (db-sequ-open *db* 'sequ1 :create t))
+#<BDB::DB-SEQUENCE-TXN {B5C3841}>
+BDB-EXT-PLAYGROUND> (db-sequ-get *sequ*)
+0
+BDB-EXT-PLAYGROUND> (db-sequ-get *sequ*)
+1
+BDB-EXT-PLAYGROUND> (db-sequ-get *sequ*)
+2
+BDB-EXT-PLAYGROUND> (db-sequ-get *sequ*)
+3
+BDB-EXT-PLAYGROUND> (db-sequ-get *sequ*)
+4
+BDB-EXT-PLAYGROUND> (db-sequ-get *sequ*)
+5
+BDB-EXT-PLAYGROUND> (db-sequ-get *sequ*)
+6
+BDB-EXT-PLAYGROUND> (db-sequ-get *sequ*)
+7
+BDB-EXT-PLAYGROUND> (db-sequ-get *sequ*)
+8
+BDB-EXT-PLAYGROUND> (db-sequ-get *sequ* :delta 5)
+9
+BDB-EXT-PLAYGROUND> (db-sequ-get *sequ* :delta 5)
+14
+BDB-EXT-PLAYGROUND> (db-sequ-get *sequ* :delta 5)
+19
+BDB-EXT-PLAYGROUND> (db-sequ-get *sequ* :delta 5)
+24
+BDB-EXT-PLAYGROUND> (db-sequ-close *sequ*)
+T
+BDB-EXT-PLAYGROUND> (db-close *db*)
+T
+BDB-EXT-PLAYGROUND> (db-env-close *env*)
+NIL
+BDB-EXT-PLAYGROUND> ;;bye bye
+	
+

+ + + +
+ Valid XHTML 1.0 Strict +
+ + + diff --git a/index.html b/index.html index 35bf9eeeb71a491a9703316f50374f80ed6db4c3..33b5c6c4eb5ba38bfd41eab7a99b644c91ee59f4 100644 --- a/index.html +++ b/index.html @@ -148,6 +148,7 @@
  • Secondary Databases
  • Transactions
  • DB-Ext Test
  • +
  • Sequences
  • Mailing Lists