On 4/14/07, Jon Tirsen <[EMAIL PROTECTED]> wrote:
> I'm trying to implement the "quote_column_name" in HSQLDB. Anyone
> familiar with how you're supposed to be quoting in HSQLDB?
>
> According to the HSQLDB manual[1] you are supposed to be using double-
> quotes. Unfortunately this means that the quotes actually become part
> of the column name in the table definition with the unfortunate side-
> effect that you can no longer use the unquoted name in SQL.

Wow, that sucks.  Why can't you get away w/ unquoted column names?

>
> For example, we have a migration that looks something like this:
>      add_column :mytable, :created_at, :timestamp
>      add_column :mytable, :updated_at, :timestamp
>      execute "UPDATE mytable SET created_at = '#{now}', updated_at =
> '#{now}'"
>
> When I implement quote_column_name as:
>      def quote_column_name(name) #:nodoc:
>          "\"#{name}\""
>      end
>
> Then this migration now fails as the name of the column is now
> verbatim '"created_at"' (including the quotes) and not 'created_at'
> as I would prefer. Which means that in the update statement
> afterwards HSQLDB can't find the 'created_at' column.
>

We used to have HSQLDB working much better.  Migrations were working
and persisting, etc.  Recently, a week or two before the 0.9.8 release
I noticed migrations weren't "taking" even though they didn't report
error.  I still haven't had the chance to look into that issue.

Also, the hsqldb AR-JDBC unit tests are failing at the moment too.

CLASSPATH=/path/to/hsqldb.jar jruby --command rake test_hsqldb
(In AR-JDBC root directory, to run the tests)

/Nick
_______________________________________________
Jruby-extras-devel mailing list
[EMAIL PROTECTED]
http://rubyforge.org/mailman/listinfo/jruby-extras-devel

Reply via email to