]> gitweb.factorcode.org Git - factor.git/blob - basis/db/sqlite/errors/errors.factor
74f01f29caae48bf492adf22da830c00653f7aea
[factor.git] / basis / db / sqlite / errors / errors.factor
1 ! Copyright (C) 2009 Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors combinators db kernel sequences peg.ebnf
4 strings db.errors multiline ;
5 IN: db.sqlite.errors
6
7 TUPLE: unparsed-sqlite-error error ;
8 C: <unparsed-sqlite-error> unparsed-sqlite-error
9
10 EBNF: parse-sqlite-sql-error [=[
11
12 AlreadyExists = " already exists"
13
14 SqliteError =
15     "table " (!(AlreadyExists).)+:table AlreadyExists
16       => [[ table >string <sql-table-exists> ]]
17     | "index " (!(AlreadyExists).)+:name AlreadyExists
18       => [[ name >string <sql-index-exists> ]]
19     | "no such table: " .+:table
20       => [[ table >string <sql-table-missing> ]]
21     | .*:error
22       => [[ error >string <unparsed-sqlite-error> ]]
23 ]=]