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 ; ERROR: bad-schema ;
TUPLE: sql-unknown-error < sql-error message ; TUPLE: sql-unknown-error < sql-error message ;
: <sql-unknown-error> ( message -- error ) : <sql-unknown-error> ( message -- error )
\ sql-unknown-error new f swap sql-unknown-error boa ;
swap >>message ;
TUPLE: sql-table-exists < sql-error table ; TUPLE: sql-table-exists < sql-error table ;
: <sql-table-exists> ( table -- error ) : <sql-table-exists> ( table -- error )
\ sql-table-exists new f swap sql-table-exists boa ;
swap >>table ;
TUPLE: sql-table-missing < sql-error table ; TUPLE: sql-table-missing < sql-error table ;
: <sql-table-missing> ( table -- error ) : <sql-table-missing> ( table -- error )
\ sql-table-missing new f swap sql-table-missing boa ;
swap >>table ;
TUPLE: sql-syntax-error < sql-error message ; TUPLE: sql-syntax-error < sql-error message ;
: <sql-syntax-error> ( message -- error ) : <sql-syntax-error> ( message -- error )
\ sql-syntax-error new f swap sql-syntax-error boa ;
swap >>message ;
TUPLE: sql-function-exists < sql-error message ; TUPLE: sql-function-exists < sql-error message ;
: <sql-function-exists> ( message -- error ) : <sql-function-exists> ( message -- error )
\ sql-function-exists new f swap sql-function-exists boa ;
swap >>message ;
TUPLE: sql-function-missing < sql-error message ; TUPLE: sql-function-missing < sql-error message ;
: <sql-function-missing> ( message -- error ) : <sql-function-missing> ( message -- error )
\ sql-function-missing new f swap sql-function-missing boa ;
swap >>message ;
TUPLE: sql-database-exists < sql-error message ; TUPLE: sql-database-exists < sql-error message ;
: <sql-database-exists> ( message -- error ) : <sql-database-exists> ( message -- error )
\ sql-database-exists new f swap sql-database-exists boa ;
swap >>message ;
: ignore-error ( quot word -- ) : ignore-error ( quot word -- )
'[ dup _ execute [ drop ] [ rethrow ] if ] recover ; inline '[ dup @ [ drop ] [ rethrow ] if ] recover ; inline
: ignore-table-exists ( quot -- ) : ignore-table-exists ( quot -- )
\ sql-table-exists? ignore-error ; inline [ sql-table-exists? ] ignore-error ; inline
: ignore-table-missing ( quot -- ) : ignore-table-missing ( quot -- )
\ sql-table-missing? ignore-error ; inline [ sql-table-missing? ] ignore-error ; inline
: ignore-function-exists ( quot -- ) : ignore-function-exists ( quot -- )
\ sql-function-exists? ignore-error ; inline [ sql-function-exists? ] ignore-error ; inline
: ignore-function-missing ( quot -- ) : ignore-function-missing ( quot -- )
\ sql-function-missing? ignore-error ; inline [ sql-function-missing? ] ignore-error ; inline
: ignore-database-exists ( quot -- ) : 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. ! Copyright (C) 2009 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: accessors combinators.short-circuit db db.errors USING: accessors combinators.short-circuit db db.errors
db.errors.postgresql db.postgresql io.files.unique kernel namespaces db.postgresql db.postgresql.errors io.files.unique kernel
tools.test db.tester continuations ; namespaces tools.test db.tester continuations ;
IN: db.errors.postgresql.tests
[ [

View File

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

View File

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

View File

@ -1,9 +1,8 @@
! Copyright (C) 2009 Doug Coleman. ! Copyright (C) 2009 Doug Coleman.
! See http://factorcode.org/license.txt for BSD license. ! See http://factorcode.org/license.txt for BSD license.
USING: accessors combinators.short-circuit db db.errors 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 ; namespaces tools.test ;
IN: db.errors.sqlite.tests
[ [
"sqlite" "error-test" [ "sqlite" "error-test" [

View File

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

View File

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