1 ! Copyright (C) 2008 Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors kernel continuations fry words ;
7 TUPLE: sql-error location ;
11 TUPLE: sql-unknown-error < sql-error message ;
13 : <sql-unknown-error> ( message -- error )
14 f swap sql-unknown-error boa ;
16 TUPLE: sql-table-exists < sql-error table ;
18 : <sql-table-exists> ( table -- error )
19 f swap sql-table-exists boa ;
21 TUPLE: sql-table-missing < sql-error table ;
23 : <sql-table-missing> ( table -- error )
24 f swap sql-table-missing boa ;
26 TUPLE: sql-syntax-error < sql-error message ;
28 : <sql-syntax-error> ( message -- error )
29 f swap sql-syntax-error boa ;
31 TUPLE: sql-function-exists < sql-error message ;
33 : <sql-function-exists> ( message -- error )
34 f swap sql-function-exists boa ;
36 TUPLE: sql-function-missing < sql-error message ;
38 : <sql-function-missing> ( message -- error )
39 f swap sql-function-missing boa ;
41 TUPLE: sql-database-exists < sql-error message ;
43 : <sql-database-exists> ( message -- error )
44 f swap sql-database-exists boa ;
46 TUPLE: sql-index-exists < sql-error name ;
48 : <sql-index-exists> ( name -- error )
49 f swap sql-index-exists boa ;
51 : ignore-table-exists ( quot -- )
52 [ sql-table-exists? ] ignore-error ; inline
54 : ignore-table-missing ( quot -- )
55 [ sql-table-missing? ] ignore-error ; inline
57 : ignore-function-exists ( quot -- )
58 [ sql-function-exists? ] ignore-error ; inline
60 : ignore-function-missing ( quot -- )
61 [ sql-function-missing? ] ignore-error ; inline
63 : ignore-database-exists ( quot -- )
64 [ sql-database-exists? ] ignore-error ; inline
66 : ignore-index-exists ( quot -- )
67 [ sql-index-exists? ] ignore-error ; inline