new accessors
parent
41fc9eac0f
commit
b07cb1e803
|
@ -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
|
||||
|
|
|
@ -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 -- )
|
||||
{
|
||||
|
|
|
@ -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 -- )
|
||||
|
|
|
@ -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 -- )
|
||||
|
|
Loading…
Reference in New Issue