]> gitweb.factorcode.org Git - factor.git/commitdiff
new accessors
authorDoug Coleman <doug.coleman@gmail.com>
Sun, 31 Aug 2008 07:51:55 +0000 (02:51 -0500)
committerDoug Coleman <doug.coleman@gmail.com>
Sun, 31 Aug 2008 07:51:55 +0000 (02:51 -0500)
extra/db/mysql/lib/lib.factor
extra/db/sqlite/lib/lib.factor
extra/db/sqlite/sqlite.factor
extra/db/tuples/tuples.factor

index ca912f200d65611d1871c592edfb43837f75a299..47033c1c617f07b3fff660b2294eada78dd9e105 100644 (file)
@@ -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 
index d14e975ae13feec8736c17ecdba72cdd17427bb0..03f424e8d464c280932e86143018b4c1ee38988d 100755 (executable)
@@ -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 -- )
     {
index 38a3899fc490c34e2d9d81a958c5fb2a713dcf7d..794ff5bacdeb139704a2ebc9c5eb85c09fcb5b00 100755 (executable)
@@ -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 -- )
index 71cf878d2f75d091297fb5c90b9d6ca870037f55..1b7ab24366898ee09251249f31e5db57e3418c65 100755 (executable)
@@ -141,7 +141,7 @@ M: retryable execute-statement* ( statement type -- )
 
 : update-tuple ( tuple -- )
     dup class
-    db get db-update-statements [ <update-tuple-statement> ] cache
+    db get update-statements>> [ <update-tuple-statement> ] cache
     [ bind-tuple ] keep execute-statement ;
 
 : delete-tuples ( tuple -- )