1 ! Copyright (C) 2008 Doug Coleman.
2 ! See http://factorcode.org/license.txt for license.
3 USING: alien continuations destructors io kernel prettyprint
4 sequences db db.mysql.ffi ;
7 TUPLE: mysql-db handle host user password db port ;
8 TUPLE: mysql-statement ;
9 TUPLE: mysql-result-set ;
11 M: mysql-db db-open ( mysql-db -- )
14 M: mysql-db dispose ( mysql-db -- )
15 mysql-db-handle mysql_close ;
17 M: mysql-db <simple-statement> ( str in out -- statement )
20 M: mysql-db <prepared-statement> ( str in out -- statement )
23 M: mysql-statement prepare-statement ( statement -- )
26 M: mysql-statement bind-statement* ( statement -- )
29 M: mysql-statement query-results ( query -- result-set )
32 M: mysql-result-set #rows ( result-set -- n )
35 M: mysql-result-set #columns ( result-set -- n )
38 M: mysql-result-set row-column ( result-set n -- obj )
41 M: mysql-result-set advance-row ( result-set -- )
44 M: mysql-db begin-transaction ( -- )
47 M: mysql-db commit-transaction ( -- )
50 M: mysql-db rollback-transaction ( -- )