>> > Neither PostgreSQL, Oracle, nor Firebird supports autoincrement, they
>> all
>> > use sequences.  I'm not sure if OpenEdge uses something similar to
>> > sequences, but if so, it should be possible to get the tests passing.
>>  If
>> > there's really no way to insert a row and get back an identifier for
>> the
>> > row, then yes, it's unlikely it could pass most of the test suite.
>>
>> Thought about this too, but apparently not :-/
>>
>> http://stackoverflow.com/questions/9753744/properly-implementing-auto-incrementing-primary-keys-in-openedge-10-2b-using-sql
>>
>
> Oracle has similar behavior, where the sequence name must be specified.
>  Sequel's Oracle support comes with an :autosequence Database option that
> will guess the sequence to use based on the table name, and sets the
> create_table method to have the table use that sequence.  Probably not all
> that useful in production with a pre-existing database (and therefore off
> by default), but it allows the tests to run, and works fine for developing
> new databases.

OK, that sounds good actually :)

So I had a brief look, I take it what I'd need to do is to:

- implement Sequel::Database#last_insert_id
- implement Sequel::Database#sequence_for_table
- override Sequel::Database#execute_insert to return last_insert_id
- override Sequel::Database#alter_table_sql and
Sequel::Database#create_table_sql (e.g. in
Sequel::OpenEdge::DatabaseMethods) to drop/create sequence if necessary

Does that look sensible, or have I missed anything?  What about drop
table/drop column?

Thanks for your ideas! :)



-- 
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 http://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.

Reply via email to