From b0e322bffc2e59e38e4b373d1b4922b2fc933be4 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Mon, 7 Apr 2008 14:19:29 -0500 Subject: [PATCH] refactor db some --- extra/db/db.factor | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/extra/db/db.factor b/extra/db/db.factor index 3cade1a895..1a1a18c942 100755 --- a/extra/db/db.factor +++ b/extra/db/db.factor @@ -41,6 +41,7 @@ TUPLE: simple-statement < statement ; TUPLE: prepared-statement < statement ; TUPLE: nonthrowable-statement < statement ; TUPLE: throwable-statement < statement ; + : make-nonthrowable ( obj -- obj' ) dup sequence? [ [ make-nonthrowable ] map @@ -49,6 +50,7 @@ TUPLE: throwable-statement < statement ; ] if ; TUPLE: result-set sql in-params out-params handle n max ; + : construct-statement ( sql in out class -- statement ) construct-empty swap >>out-params @@ -101,10 +103,6 @@ M: nonthrowable-statement execute-statement ( statement -- ) swap >>in-params 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 ) dup #columns [ row-column ] with map ;