[SCM] Lisaac library sqlite-binding branch, master, updated. 9e114201fbe7af88ecf12e33cac1b1d3d88d92e1
Jeremy Cowgar
jeremy at cowgar.com
Tue Nov 11 01:34:59 UTC 2008
The following commit has been merged in the master branch:
commit 9e114201fbe7af88ecf12e33cac1b1d3d88d92e1
Author: Jeremy Cowgar <jeremy at cowgar.com>
Date: Mon Nov 10 20:34:02 2008 -0500
* Added warning about API change to README
* Moved example.li to examples.git repo
diff --git a/README b/README
index e69de29..0c62cfb 100644
--- a/README
+++ b/README
@@ -0,0 +1,3 @@
+WARNING
+
+This is in an initial state and there will be changes to the API.
diff --git a/example.li b/example.li
deleted file mode 100644
index 19838bc..0000000
--- a/example.li
+++ /dev/null
@@ -1,71 +0,0 @@
-Section Header
- + name := EXAMPLE;
-
-Section Public
- - main <-
- (
- + d:SQLITE;
- + s:SQLITE_STATEMENT;
-
- "Opening database example.db\n".print;
- d := SQLITE.open("example.db");
-
- d.is_empty.if {
- "Creating our names table\n".print;
- ( d.exec ("CREATE TABLE names (id INTEGER, name VARCHAR(20))") != SQLITE.ok ).if {
- "Could not create new names table!\n".print;
- OBJECT.die_with_code 1;
- };
- };
-
- ( COMMAND_LINE.upper > 1 ).if {
- "Inserting new names from the command line\n".print;
- s := d.prepare("INSERT INTO names VALUES (?,?)");
- 1.to (COMMAND_LINE.upper) do { i:INTEGER;
- s.bind 1 to_integer i;
- s.bind 2 to_string (COMMAND_LINE.item i);
- ( s.step != SQLITE.done ).if {
- ( "Error inserting new record: " + d.errmsg + "\n").print;
- OBJECT.die_with_code 1;
- };
- (" Inserted: " + (COMMAND_LINE.item i) + "\n").print;
- s.reset;
- };
- s.finalize;
- };
-
- "Querying all records from the names table\n".print;
-
- /*
- s := d.prepare("SELECT * FROM names");
- { s.step = SQLITE.row }.while_do {
- ( s.as_string 0 + " " + s.as_string 1 + "\n").print;
- };
- s.finalize;
- */
-
- /*
- s := d.prepare("SELECT * FROM names");
- s.foreach {
- ( s.as_string 0 + " " + s.as_string 1 + "\n").print;
- };
- s.finalize;
- */
-
- d.foreach "SELECT * FROM names" do { row:SQLITE_STATEMENT;
- ( " " + row.as_string 0 + " " + row.as_string 1 + "\n").print;
- } else {
- " No results found...\n".print;
- " use ./example Name1 Name2 Name3 to add some\n".print;
- };
-
- "Querying all records with id > 10 from the names table\n".print;
- d.foreach "SELECT * FROM names WHERE id > 10" do { row:SQLITE_STATEMENT;
- ( " " + row.as_string 0 + " " + row.as_string 1 + "\n").print;
- } else {
- " No results found for id > 10\n".print;
- };
-
- "Closing database\n".print;
- d.close;
- );
--
Lisaac library sqlite-binding
More information about the Lisaac-commits
mailing list