I needed to add temporary table support in activerecord-
oracle_enhanced-adapter (http://github.com/rsim/oracle-enhanced) for
the project I'm working on. For some reason the syntax to create a
temp table in Oracle is 'CREATE GLOBAL TEMPORARY TABLE' - but
ActiveRecord::ConnectionAdapters::SchemaStatements#create_table has it
as 'CREATE TEMPORARY TABLE' without any way of configuring it. This
forced me to override the create_table method in the oracle adapter in
order to apply the feature.
I was not able to determine that 'CREATE TEMPORARY TABLE' is any sort
of standard (at least, I couldn't find anything defining it in ANSI).
I'm considering submitting a patch to make the syntax configurable
somehow. Before I even bother doing that, I was hoping to get some
feedback - i.e. whether or not this will be shot down from the get-
go.
The Oracle adapter is external to the rails code base now. I recommend you fork the rsim github code, apply your patch with tests and do a pull request.
As someone who has used Rails with Oracle, I feel your pain and would love to see some points like this fixed.
Re the ANSI standard, as you are coding the oracle adapter, then this really a moot point, what works with Oracle works for Oracle.
If you need to patch rails to make it more database agnostic, I would think now is a good time to do it
Mikel...
I did fork oracle_enhanced to add this feature. I'm mostly concerned
because I had to redefine create_table without calling super at all.
Is this a valid concern?
Mikel...
I did fork oracle_enhanced to add this feature. I'm mostly concerned
because I had to redefine create_table without calling super at all.
Is this a valid concern?
That does seem a little shitty. Take a look at refactoring the method
in AR to make it easier for you to selectively override rather than
just reimplement the whole thing. Assuming the patch isn't too
intrusive we can apply it.