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.
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.
Grr...
[1] http://hsqldb.org/doc/guide/ch09.html#expression-section
Cheers,
Jon
----
New from ThoughtWorks: Mingle, an Agile project management application.
Mingle. Project Intelligence. Powerfully Simple.
More at http://studios.thoughtworks.com
_______________________________________________
Jruby-extras-devel mailing list
[EMAIL PROTECTED]
http://rubyforge.org/mailman/listinfo/jruby-extras-devel