| 
									
										
										
										
											2008-05-30 19:00:42 -04:00
										 |  |  | ! Copyright (C) 2008 Doug Coleman. | 
					
						
							|  |  |  | ! See http://factorcode.org/license.txt for BSD license. | 
					
						
							| 
									
										
										
										
											2018-02-14 13:39:09 -05:00
										 |  |  | USING: continuations kernel ;
 | 
					
						
							| 
									
										
										
										
											2008-05-30 19:00:42 -04:00
										 |  |  | IN: db.errors | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | ERROR: db-error ;
 | 
					
						
							| 
									
										
										
										
											2010-02-03 13:25:55 -05:00
										 |  |  | TUPLE: sql-error location ;
 | 
					
						
							| 
									
										
										
										
											2008-05-30 19:00:42 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | ERROR: bad-schema ;
 | 
					
						
							| 
									
										
										
										
											2009-02-20 21:40:17 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-01 15:40:56 -05:00
										 |  |  | TUPLE: sql-unknown-error < sql-error message ;
 | 
					
						
							| 
									
										
										
										
											2016-03-22 15:44:23 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-02-21 22:59:23 -05:00
										 |  |  | : <sql-unknown-error> ( message -- error )
 | 
					
						
							| 
									
										
										
										
											2016-03-22 15:44:23 -04:00
										 |  |  |     f swap sql-unknown-error boa ;
 | 
					
						
							| 
									
										
										
										
											2009-02-21 22:59:23 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-01 15:40:56 -05:00
										 |  |  | TUPLE: sql-table-exists < sql-error table ;
 | 
					
						
							| 
									
										
										
										
											2016-03-22 15:44:23 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-02-21 22:22:51 -05:00
										 |  |  | : <sql-table-exists> ( table -- error )
 | 
					
						
							| 
									
										
										
										
											2016-03-22 15:44:23 -04:00
										 |  |  |     f swap sql-table-exists boa ;
 | 
					
						
							| 
									
										
										
										
											2009-02-20 21:40:17 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-01 15:40:56 -05:00
										 |  |  | TUPLE: sql-table-missing < sql-error table ;
 | 
					
						
							| 
									
										
										
										
											2016-03-22 15:44:23 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-02-21 22:22:51 -05:00
										 |  |  | : <sql-table-missing> ( table -- error )
 | 
					
						
							| 
									
										
										
										
											2016-03-22 15:44:23 -04:00
										 |  |  |     f swap sql-table-missing boa ;
 | 
					
						
							| 
									
										
										
										
											2009-02-20 21:40:17 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-01 15:40:56 -05:00
										 |  |  | TUPLE: sql-syntax-error < sql-error message ;
 | 
					
						
							| 
									
										
										
										
											2016-03-22 15:44:23 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-02-21 22:22:51 -05:00
										 |  |  | : <sql-syntax-error> ( message -- error )
 | 
					
						
							| 
									
										
										
										
											2016-03-22 15:44:23 -04:00
										 |  |  |     f swap sql-syntax-error boa ;
 | 
					
						
							| 
									
										
										
										
											2009-02-21 22:59:23 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-01 15:40:56 -05:00
										 |  |  | TUPLE: sql-function-exists < sql-error message ;
 | 
					
						
							| 
									
										
										
										
											2016-03-22 15:44:23 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-02-21 22:59:23 -05:00
										 |  |  | : <sql-function-exists> ( message -- error )
 | 
					
						
							| 
									
										
										
										
											2016-03-22 15:44:23 -04:00
										 |  |  |     f swap sql-function-exists boa ;
 | 
					
						
							| 
									
										
										
										
											2009-02-21 22:59:23 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-01 15:40:56 -05:00
										 |  |  | TUPLE: sql-function-missing < sql-error message ;
 | 
					
						
							| 
									
										
										
										
											2016-03-22 15:44:23 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-02-21 22:59:23 -05:00
										 |  |  | : <sql-function-missing> ( message -- error )
 | 
					
						
							| 
									
										
										
										
											2016-03-22 15:44:23 -04:00
										 |  |  |     f swap sql-function-missing boa ;
 | 
					
						
							| 
									
										
										
										
											2009-02-21 22:59:23 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-04 17:52:44 -04:00
										 |  |  | TUPLE: sql-database-exists < sql-error message ;
 | 
					
						
							| 
									
										
										
										
											2016-03-22 15:44:23 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-04 17:52:44 -04:00
										 |  |  | : <sql-database-exists> ( message -- error )
 | 
					
						
							| 
									
										
										
										
											2016-03-22 15:44:23 -04:00
										 |  |  |     f swap sql-database-exists boa ;
 | 
					
						
							| 
									
										
										
										
											2011-09-04 17:52:44 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-02-20 13:00:50 -05:00
										 |  |  | TUPLE: sql-index-exists < sql-error name ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | : <sql-index-exists> ( name -- error )
 | 
					
						
							|  |  |  |     f swap sql-index-exists boa ;
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-02-21 22:59:23 -05:00
										 |  |  | : ignore-table-exists ( quot -- )
 | 
					
						
							| 
									
										
										
										
											2016-03-22 15:44:23 -04:00
										 |  |  |     [ sql-table-exists? ] ignore-error ; inline
 | 
					
						
							| 
									
										
										
										
											2009-02-21 22:59:23 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | : ignore-table-missing ( quot -- )
 | 
					
						
							| 
									
										
										
										
											2016-03-22 15:44:23 -04:00
										 |  |  |     [ sql-table-missing? ] ignore-error ; inline
 | 
					
						
							| 
									
										
										
										
											2009-02-21 22:59:23 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | : ignore-function-exists ( quot -- )
 | 
					
						
							| 
									
										
										
										
											2016-03-22 15:44:23 -04:00
										 |  |  |     [ sql-function-exists? ] ignore-error ; inline
 | 
					
						
							| 
									
										
										
										
											2009-02-21 22:59:23 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | : ignore-function-missing ( quot -- )
 | 
					
						
							| 
									
										
										
										
											2016-03-22 15:44:23 -04:00
										 |  |  |     [ sql-function-missing? ] ignore-error ; inline
 | 
					
						
							| 
									
										
										
										
											2011-09-04 17:52:44 -04:00
										 |  |  | 
 | 
					
						
							|  |  |  | : ignore-database-exists ( quot -- )
 | 
					
						
							| 
									
										
										
										
											2016-03-22 15:44:23 -04:00
										 |  |  |     [ sql-database-exists? ] ignore-error ; inline
 | 
					
						
							| 
									
										
										
										
											2016-02-20 13:00:50 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | : ignore-index-exists ( quot -- )
 | 
					
						
							|  |  |  |     [ sql-index-exists? ] ignore-error ; inline
 |