[Ur] SQL error using sqlite

Adam Chlipala adamc at impredicative.com
Thu Dec 16 10:04:29 EST 2010


Chris Double wrote:
> I have a module with a '-' in the name. eg. 'my-example'. When I use a
> database table in the project with the sqlite backend, teh SQL
> generated has a '-' in the generated table names which sqlite doesn't
> handle and gives an error
>    

As for most programming languages, dashes aren't allowed in Ur 
identifiers.  The lexer won't allow dashes in identifiers that appear 
explicitly in programs.  Every .ur source filename is also turned into a 
module identifier automatically, but I now realize the compiler wasn't 
enforcing that the same identifier rules were followed.  I've now pushed 
a change that would reject a filename like my-example.ur.  I recommend 
using underscores in place of dashes.

BTW, this turns out not to have anything to do with SQLite.  I expect 
the same error would show up with the other DBMSes.  All of them are 
meant to be supported soundly by Ur/Web.

P.S.: It can be hard to tell whether a message is a "bug report," a 
"question," or a "discussion starter."  This one seems like a bug report 
to me, in which case it's more convenient for me if it's opened as an 
issue in the Ur Mantis, rather than sent to the mailing list.  In 
general, if you can get a parse error from GCC or a DBMS, then it's a 
bug. :)  (Except in some cases where you use the FFI to do obscene things)



More information about the Ur mailing list