fix circularity in db

db4
sheeple 2009-02-20 22:59:01 -06:00
parent c6d3c91ad6
commit a1f3e5695b
6 changed files with 19 additions and 19 deletions

View File

@ -5,14 +5,14 @@ namespaces sequences classes.tuple words strings
tools.walker accessors combinators fry db.errors ;
IN: db
<PRIVATE
TUPLE: db-connection
handle
insert-statements
update-statements
delete-statements ;
<PRIVATE
: new-db-connection ( class -- obj )
new
H{ } clone >>insert-statements
@ -23,6 +23,7 @@ PRIVATE>
GENERIC: db-open ( db -- db-connection )
HOOK: db-close db-connection ( handle -- )
HOOK: parse-db-error db-connection ( error -- error' )
: dispose-statements ( assoc -- ) values dispose-each ;

View File

@ -1,10 +1,8 @@
! Copyright (C) 2008 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: kernel db.private ;
USING: kernel ;
IN: db.errors
HOOK: parse-db-error db-connection ( error -- error' )
ERROR: db-error ;
ERROR: sql-error ;

View File

@ -2,6 +2,3 @@
! See http://factorcode.org/license.txt for BSD license.
USING: ;
IN: db.errors.postgresql
M: postgresql-db-connection parse-db-error
;

View File

@ -1,7 +1,7 @@
! Copyright (C) 2009 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors combinators db.errors db.sqlite.private kernel
sequences peg.ebnf strings ;
USING: accessors combinators db kernel sequences peg.ebnf
strings db.errors ;
IN: db.errors.sqlite
ERROR: unparsed-sqlite-error error ;
@ -23,9 +23,3 @@ SqliteError =
| "no such table: " .+:table
=> [[ table >string <sql-table-missing> ]]
;EBNF
M: sqlite-db-connection parse-db-error
dup n>> {
{ 1 [ string>> parse-sqlite-sql-error ] }
[ drop ]
} case ;

View File

@ -5,8 +5,8 @@ kernel math math.parser namespaces make prettyprint quotations
sequences debugger db db.postgresql.lib db.postgresql.ffi
db.tuples db.types tools.annotations math.ranges
combinators classes locals words tools.walker db.private
nmake accessors random db.queries destructors db.tuples.private ;
USE: tools.walker
nmake accessors random db.queries destructors db.tuples.private
db.postgresql ;
IN: db.postgresql
TUPLE: postgresql-db host port pgopts pgtty database username password ;
@ -280,3 +280,6 @@ M: postgresql-db-connection compound ( string object -- string' )
{ "references" [ >reference-string ] }
[ drop no-compound-found ]
} case ;
M: postgresql-db-connection parse-db-error
;

View File

@ -6,7 +6,8 @@ sequences strings classes.tuple alien.c-types continuations
db.sqlite.lib db.sqlite.ffi db.tuples words db.types combinators
math.intervals io nmake accessors vectors math.ranges random
math.bitwise db.queries destructors db.tuples.private interpolate
io.streams.string multiline make db.private sequences.deep ;
io.streams.string multiline make db.private sequences.deep
db.errors.sqlite ;
IN: db.sqlite
TUPLE: sqlite-db path ;
@ -347,3 +348,9 @@ M: sqlite-db-connection compound ( string seq -- new-string )
{ "references" [ >reference-string ] }
[ 2drop ]
} case ;
M: sqlite-db-connection parse-db-error
dup n>> {
{ 1 [ string>> parse-sqlite-sql-error ] }
[ drop ]
} case ;