refactor db some
parent
a5d6c38439
commit
b0e322bffc
|
@ -41,6 +41,7 @@ TUPLE: simple-statement < statement ;
|
||||||
TUPLE: prepared-statement < statement ;
|
TUPLE: prepared-statement < statement ;
|
||||||
TUPLE: nonthrowable-statement < statement ;
|
TUPLE: nonthrowable-statement < statement ;
|
||||||
TUPLE: throwable-statement < statement ;
|
TUPLE: throwable-statement < statement ;
|
||||||
|
|
||||||
: make-nonthrowable ( obj -- obj' )
|
: make-nonthrowable ( obj -- obj' )
|
||||||
dup sequence? [
|
dup sequence? [
|
||||||
[ make-nonthrowable ] map
|
[ make-nonthrowable ] map
|
||||||
|
@ -49,6 +50,7 @@ TUPLE: throwable-statement < statement ;
|
||||||
] if ;
|
] if ;
|
||||||
|
|
||||||
TUPLE: result-set sql in-params out-params handle n max ;
|
TUPLE: result-set sql in-params out-params handle n max ;
|
||||||
|
|
||||||
: construct-statement ( sql in out class -- statement )
|
: construct-statement ( sql in out class -- statement )
|
||||||
construct-empty
|
construct-empty
|
||||||
swap >>out-params
|
swap >>out-params
|
||||||
|
@ -101,10 +103,6 @@ M: nonthrowable-statement execute-statement ( statement -- )
|
||||||
swap >>in-params
|
swap >>in-params
|
||||||
swap >>sql ;
|
swap >>sql ;
|
||||||
|
|
||||||
! >r >r { sql>> in-params>> out-params>> } get-slots r>
|
|
||||||
! { (>>sql) (>>in-params) (>>out-params) (>>handle) } result-set
|
|
||||||
! construct r> construct-delegate ;
|
|
||||||
|
|
||||||
: sql-row ( result-set -- seq )
|
: sql-row ( result-set -- seq )
|
||||||
dup #columns [ row-column ] with map ;
|
dup #columns [ row-column ] with map ;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue