From b07cb1e8035df1a6c87e0d399f9efd7460e461b2 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Sun, 31 Aug 2008 02:51:55 -0500 Subject: [PATCH] new accessors --- extra/db/mysql/lib/lib.factor | 2 +- extra/db/sqlite/lib/lib.factor | 4 ++-- extra/db/sqlite/sqlite.factor | 2 +- extra/db/tuples/tuples.factor | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/extra/db/mysql/lib/lib.factor b/extra/db/mysql/lib/lib.factor index ca912f200d..47033c1c61 100644 --- a/extra/db/mysql/lib/lib.factor +++ b/extra/db/mysql/lib/lib.factor @@ -34,7 +34,7 @@ TUPLE: mysql-result-set ; ! ========================================================= : (mysql-query) ( mysql-connection query -- ret ) - >r mysql-db-handle r> mysql_query ; + >r db-handle>> r> mysql_query ; ! : (mysql-result) ( mysql-connection -- ret ) ! [ mysql-db-handle mysql_use_result ] keep diff --git a/extra/db/sqlite/lib/lib.factor b/extra/db/sqlite/lib/lib.factor index d14e975ae1..03f424e8d4 100755 --- a/extra/db/sqlite/lib/lib.factor +++ b/extra/db/sqlite/lib/lib.factor @@ -5,7 +5,7 @@ namespaces sequences db.sqlite.ffi db combinators continuations db.types calendar.format serialize io.streams.byte-array byte-arrays io.encodings.binary io.backend db.errors present urls io.encodings.utf8 -io.encodings.string ; +io.encodings.string accessors ; IN: db.sqlite.lib ERROR: sqlite-error < db-error n string ; @@ -16,7 +16,7 @@ ERROR: sqlite-sql-error < sql-error n string ; : sqlite-statement-error ( -- * ) SQLITE_ERROR - db get db-handle sqlite3_errmsg sqlite-sql-error ; + db get handle>> sqlite3_errmsg sqlite-sql-error ; : sqlite-check-result ( n -- ) { diff --git a/extra/db/sqlite/sqlite.factor b/extra/db/sqlite/sqlite.factor index 38a3899fc4..794ff5bacd 100755 --- a/extra/db/sqlite/sqlite.factor +++ b/extra/db/sqlite/sqlite.factor @@ -90,7 +90,7 @@ M: sqlite-statement bind-tuple ( tuple statement -- ) ] keep bind-statement ; : last-insert-id ( -- id ) - db get db-handle sqlite3_last_insert_rowid + db get handle>> sqlite3_last_insert_rowid dup zero? [ "last-id failed" throw ] when ; M: sqlite-db insert-tuple* ( tuple statement -- ) diff --git a/extra/db/tuples/tuples.factor b/extra/db/tuples/tuples.factor index 71cf878d2f..1b7ab24366 100755 --- a/extra/db/tuples/tuples.factor +++ b/extra/db/tuples/tuples.factor @@ -141,7 +141,7 @@ M: retryable execute-statement* ( statement type -- ) : update-tuple ( tuple -- ) dup class - db get db-update-statements [ ] cache + db get update-statements>> [ ] cache [ bind-tuple ] keep execute-statement ; : delete-tuples ( tuple -- )