On 16 avr, 04:48, Jeremy Evans <[email protected]> wrote:
> First, thanks for working on the patch.  
You're welcome

> I'd like to refactor it slightly before I merge it to reduce the amount of 
> duplication.
thanks to help me cleaning this ugly code :)

>
> Try adding a Database#temporary_table_sql private method in database/
> schema_sql.rb:
>
>   def temporary_table_sql
>     "TEMPORARY "
>   end

I added this method and also the constant like you did for
AUTO_INCREMENT like stuff

> Then modify create_table_sql_list in the same file:
>
>   sql = ["CREATE #{temporary_table_sql if options[:temp]}TABLE #
> {quote_schema_table(name)} (#{column_list_sql(columns)})"]

done.

> You'll have to override temporary_table_sql in the Oracle and MSSQL
> shared adapters, and modify create_table_sql_list in the MySQL and
> Firebird adapters, but those should be the only changes required.  I
> think this is better than overriding create_table_sql list in a
> similar way in all adapters.

I overrode the constant in all these adapters:
- db2 (same syntax than Oracle)
- firebird (no temporary table support)
- informix (TEMP instead of TEMPORARY)
- oracle (GLOBAL TEMPORARY)

I overrode also create_table_sql_list for mssql because the keyword
'#'
is just before the table name instead of the 'TABLE' keyword and
modified
the create_table_sql_list method for mysql.

Question: How do you force adapter use in spec to test all this stuff
without having to install all these databases ?
I don't understand how DummyDatabase works...

Florent
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to