diff --git a/basis/db/errors/errors.factor b/basis/db/errors/errors.factor index 88dc755b0a..f33b4c5b24 100644 --- a/basis/db/errors/errors.factor +++ b/basis/db/errors/errors.factor @@ -9,54 +9,54 @@ TUPLE: sql-error location ; ERROR: bad-schema ; TUPLE: sql-unknown-error < sql-error message ; + : ( message -- error ) - \ sql-unknown-error new - swap >>message ; + f swap sql-unknown-error boa ; TUPLE: sql-table-exists < sql-error table ; + : ( table -- error ) - \ sql-table-exists new - swap >>table ; + f swap sql-table-exists boa ; TUPLE: sql-table-missing < sql-error table ; + : ( table -- error ) - \ sql-table-missing new - swap >>table ; + f swap sql-table-missing boa ; TUPLE: sql-syntax-error < sql-error message ; + : ( message -- error ) - \ sql-syntax-error new - swap >>message ; + f swap sql-syntax-error boa ; TUPLE: sql-function-exists < sql-error message ; + : ( message -- error ) - \ sql-function-exists new - swap >>message ; + f swap sql-function-exists boa ; TUPLE: sql-function-missing < sql-error message ; + : ( message -- error ) - \ sql-function-missing new - swap >>message ; + f swap sql-function-missing boa ; TUPLE: sql-database-exists < sql-error message ; + : ( 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 diff --git a/basis/db/errors/postgresql/authors.txt b/basis/db/postgresql/errors/authors.txt similarity index 100% rename from basis/db/errors/postgresql/authors.txt rename to basis/db/postgresql/errors/authors.txt diff --git a/basis/db/errors/postgresql/postgresql-tests.factor b/basis/db/postgresql/errors/errors-tests.factor similarity index 84% rename from basis/db/errors/postgresql/postgresql-tests.factor rename to basis/db/postgresql/errors/errors-tests.factor index e9be320ca9..bb7f3d862d 100644 --- a/basis/db/errors/postgresql/postgresql-tests.factor +++ b/basis/db/postgresql/errors/errors-tests.factor @@ -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 ; [ diff --git a/basis/db/errors/postgresql/postgresql.factor b/basis/db/postgresql/errors/errors.factor similarity index 98% rename from basis/db/errors/postgresql/postgresql.factor rename to basis/db/postgresql/errors/errors.factor index 1a866f52bf..4633ae2f6c 100644 --- a/basis/db/errors/postgresql/postgresql.factor +++ b/basis/db/postgresql/errors/errors.factor @@ -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 diff --git a/basis/db/postgresql/postgresql.factor b/basis/db/postgresql/postgresql.factor index 12acded9c0..12bbd56dcf 100644 --- a/basis/db/postgresql/postgresql.factor +++ b/basis/db/postgresql/postgresql.factor @@ -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 ; diff --git a/basis/db/errors/sqlite/authors.txt b/basis/db/sqlite/errors/authors.txt similarity index 100% rename from basis/db/errors/sqlite/authors.txt rename to basis/db/sqlite/errors/authors.txt diff --git a/basis/db/errors/sqlite/sqlite-tests.factor b/basis/db/sqlite/errors/errors-tests.factor similarity index 88% rename from basis/db/errors/sqlite/sqlite-tests.factor rename to basis/db/sqlite/errors/errors-tests.factor index 31eabae73d..aa162774ae 100644 --- a/basis/db/errors/sqlite/sqlite-tests.factor +++ b/basis/db/sqlite/errors/errors-tests.factor @@ -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" [ diff --git a/basis/db/errors/sqlite/sqlite.factor b/basis/db/sqlite/errors/errors.factor similarity index 97% rename from basis/db/errors/sqlite/sqlite.factor rename to basis/db/sqlite/errors/errors.factor index c73409b850..1e5da3ca94 100644 --- a/basis/db/errors/sqlite/sqlite.factor +++ b/basis/db/sqlite/errors/errors.factor @@ -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 diff --git a/basis/db/sqlite/sqlite.factor b/basis/db/sqlite/sqlite.factor index 9005b48f17..4542d800ee 100644 --- a/basis/db/sqlite/sqlite.factor +++ b/basis/db/sqlite/sqlite.factor @@ -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 ;