]> gitweb.factorcode.org Git - factor.git/blob - basis/db/sqlite/errors/errors.factor
factor: trim using lists
[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: db.errors kernel multiline peg.ebnf sequences strings ;
4 IN: db.sqlite.errors
5
6 TUPLE: unparsed-sqlite-error error ;
7 C: <unparsed-sqlite-error> unparsed-sqlite-error
8
9 EBNF: parse-sqlite-sql-error [=[
10
11 AlreadyExists = " already exists"
12
13 SqliteError =
14     "table " (!(AlreadyExists).)+:table AlreadyExists
15       => [[ table >string <sql-table-exists> ]]
16     | "index " (!(AlreadyExists).)+:name AlreadyExists
17       => [[ name >string <sql-index-exists> ]]
18     | "no such table: " .+:table
19       => [[ table >string <sql-table-missing> ]]
20     | .*:error
21       => [[ error >string <unparsed-sqlite-error> ]]
22 ]=]