! Copyright (C) 2008 Doug Coleman. ! See http://factorcode.org/license.txt for BSD license. USING: accessors kernel continuations fry words ; IN: db.errors ERROR: db-error ; TUPLE: sql-error location ; ERROR: bad-schema ; TUPLE: sql-unknown-error < sql-error message ; : ( message -- error ) f swap sql-unknown-error boa ; TUPLE: sql-table-exists < sql-error table ; : ( table -- error ) f swap sql-table-exists boa ; TUPLE: sql-table-missing < sql-error table ; : ( table -- error ) f swap sql-table-missing boa ; TUPLE: sql-syntax-error < sql-error message ; : ( message -- error ) f swap sql-syntax-error boa ; TUPLE: sql-function-exists < sql-error message ; : ( message -- error ) f swap sql-function-exists boa ; TUPLE: sql-function-missing < sql-error message ; : ( message -- error ) f swap sql-function-missing boa ; TUPLE: sql-database-exists < sql-error message ; : ( message -- error ) f swap sql-database-exists boa ; TUPLE: sql-index-exists < sql-error name ; : ( name -- error ) f swap sql-index-exists boa ; : ignore-table-exists ( quot -- ) [ sql-table-exists? ] ignore-error ; inline : ignore-table-missing ( quot -- ) [ sql-table-missing? ] ignore-error ; inline : ignore-function-exists ( quot -- ) [ sql-function-exists? ] ignore-error ; inline : ignore-function-missing ( quot -- ) [ sql-function-missing? ] ignore-error ; inline : ignore-database-exists ( quot -- ) [ sql-database-exists? ] ignore-error ; inline : ignore-index-exists ( quot -- ) [ sql-index-exists? ] ignore-error ; inline