On Wednesday, March 30, 2016 at 3:14:24 PM UTC-7, Mike Pastore wrote:
>
> Would you be open to adding a `:like` option to 
> Sequel::Dataset#create_table? This copies the schema of the source table, 
> including any indexes, but not the data. It appears to be supported in both 
> PostgreSQL and MySQL.
>

Do other databases that Sequel supports also support CREATE TABLE LIKE?  If 
not, is there a significant advantage to:

create_table(:foo, :like=>:bar)

over

run "CREATE TABLE foo LIKE bar"

On PostgreSQL, CREATE TABLE LIKE does not copy indexes, you have to use 
INCLUDE INDEXES for that.  Supporting create_table :like without 
:like_options doesn't make sense to me, and supporting :like_options would 
be a significant amount of work for a rarely used feature.  I think in this 
case it may be better to just use plain SQL for this.

This isn't a firm no, but I'm leaning against it.  If other Sequel users 
think this should be added, please speak up and explain why.

Thanks,
Jeremy

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to