db.errors: move to db.{postgresql,sqlite}.errors.

locals-and-roots
John Benediktsson 2016-03-22 12:44:23 -07:00
parent d9711b96d2
commit 6ec952c436
9 changed files with 35 additions and 42 deletions

View File

@ -9,54 +9,54 @@ TUPLE: sql-error location ;
ERROR: bad-schema ;
TUPLE: sql-unknown-error < sql-error message ;
: <sql-unknown-error> ( message -- error )
\ sql-unknown-error new
swap >>message ;
f swap sql-unknown-error boa ;
TUPLE: sql-table-exists < sql-error table ;
: <sql-table-exists> ( table -- error )
\ sql-table-exists new
swap >>table ;
f swap sql-table-exists boa ;
TUPLE: sql-table-missing < sql-error table ;
: <sql-table-missing> ( table -- error )
\ sql-table-missing new
swap >>table ;
f swap sql-table-missing boa ;
TUPLE: sql-syntax-error < sql-error message ;
: <sql-syntax-error> ( message -- error )
\ sql-syntax-error new
swap >>message ;
f swap sql-syntax-error boa ;
TUPLE: sql-function-exists < sql-error message ;
: <sql-function-exists> ( message -- error )
\ sql-function-exists new
swap >>message ;
f swap sql-function-exists boa ;
TUPLE: sql-function-missing < sql-error message ;
: <sql-function-missing> ( message -- error )
\ sql-function-missing new
swap >>message ;
f swap sql-function-missing boa ;
TUPLE: sql-database-exists < sql-error message ;
: <sql-database-exists> ( message -- error )
\ sql-database-exists new
swap >>message ;
f swap sql-database-exists boa ;
: ignore-error ( quot word -- )
'[ dup _ execute [ drop ] [ rethrow ] if ] recover ; inline
'[ dup @ [ drop ] [ rethrow ] if ] recover ; inline
: ignore-table-exists ( quot -- )
\ sql-table-exists? ignore-error ; inline
[ sql-table-exists? ] ignore-error ; inline
: ignore-table-missing ( quot -- )
\ sql-table-missing? ignore-error ; inline
[ sql-table-missing? ] ignore-error ; inline
: ignore-function-exists ( quot -- )
\ sql-function-exists? ignore-error ; inline
[ sql-function-exists? ] ignore-error ; inline
: ignore-function-missing ( quot -- )
\ sql-function-missing? ignore-error ; inline
[ sql-function-missing? ] ignore-error ; inline
: ignore-database-exists ( quot -- )
\ sql-database-exists? ignore-error ; inline
[ sql-database-exists? ] ignore-error ; inline

View File

@ -1,9 +1,8 @@
! Copyright (C) 2009 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors combinators.short-circuit db db.errors
db.errors.postgresql db.postgresql io.files.unique kernel namespaces
tools.test db.tester continuations ;
IN: db.errors.postgresql.tests
db.postgresql db.postgresql.errors io.files.unique kernel
namespaces tools.test db.tester continuations ;
[

View File

@ -3,7 +3,7 @@
USING: kernel db.errors peg.ebnf strings sequences math
combinators.short-circuit accessors math.parser quoting
locals ;
IN: db.errors.postgresql
IN: db.postgresql.errors
EBNF: parse-postgresql-sql-error

View File

@ -1,12 +1,10 @@
! Copyright (C) 2007, 2008 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: arrays assocs alien alien.syntax continuations io
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 classes.tuple locals words tools.walker
db.private nmake accessors random db.queries destructors
db.tuples.private db.postgresql db.errors.postgresql splitting ;
USING: accessors classes.tuple combinators db
db.postgresql.errors db.postgresql.ffi db.postgresql.lib
db.private db.queries db.tuples db.tuples.private db.types
destructors kernel make math math.parser namespaces nmake random
sequences splitting ;
IN: db.postgresql
TUPLE: postgresql-db host port pgopts pgtty database username password ;

View File

@ -1,9 +1,8 @@
! Copyright (C) 2009 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors combinators.short-circuit db db.errors
db.errors.sqlite db.sqlite io.files.temp io.files.unique kernel
db.sqlite db.sqlite.errors io.files.temp io.files.unique kernel
namespaces tools.test ;
IN: db.errors.sqlite.tests
[
"sqlite" "error-test" [

View File

@ -2,7 +2,7 @@
! See http://factorcode.org/license.txt for BSD license.
USING: accessors combinators db kernel sequences peg.ebnf
strings db.errors ;
IN: db.errors.sqlite
IN: db.sqlite.errors
TUPLE: unparsed-sqlite-error error ;
C: <unparsed-sqlite-error> unparsed-sqlite-error

View File

@ -1,13 +1,10 @@
! Copyright (C) 2005, 2008 Chris Double, Doug Coleman.
! See http://factorcode.org/license.txt for BSD license.
USING: alien arrays assocs classes compiler db hashtables
io.files kernel math math.parser namespaces prettyprint fry
sequences strings classes.tuple alien.c-types continuations
db.sqlite.lib db.sqlite.ffi db.tuples words db.types combinators
math.intervals io locals nmake accessors vectors math.ranges random
math.bitwise db.queries destructors db.tuples.private interpolate
io.streams.string make db.private sequences.deep
db.errors.sqlite ;
USING: accessors classes.tuple combinators db db.private
db.queries db.sqlite.errors db.sqlite.ffi db.sqlite.lib
db.tuples db.tuples.private db.types destructors interpolate
kernel locals math math.parser namespaces nmake random sequences
sequences.deep ;
IN: db.sqlite
TUPLE: sqlite-db path ;