hello mike and thanks for your answer.

no problem with ForeignKeyConstraint, but wouldn't AddConstraint go the alter
way? in this case, it will be ignored by the sqlite dialect.

what i was looking for was more like:

from sqlalchemy... import get_dialect

....
fk_parms = dict(.....)
if get_dialect() != 'mssql':
        fk_parms.update(onupdate='restrict')
fk = ForeignKey(**fk_parms)

would the dialect be accessible from the engine, metadata etc?

thanks in advance,
alex


On 07/06/2012 11:39 PM, Michael Bayer wrote:
> you'd use ForeignKeyConstraint along with the AddConstraint directive, and 
> limit it per-dialect using create/drop events as documented at 
> http://docs.sqlalchemy.org/en/rel_0_7/core/schema.html#controlling-ddl-sequences
>  .
> 
> 
> On Jul 6, 2012, at 1:30 PM, alex bodnaru wrote:
> 
>>
>> hello friends,
>>
>> i need to define a foreign key differently for different dialects:
>> ondelete='restrict' for most engines, but nothing (implied and not 
>> recognized)
>> for mssql.
>>
>> could you help?
>>
>> thanks in advance,
>> alex
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "sqlalchemy" group.
>> To post to this group, send email to sqlalchemy@googlegroups.com.
>> To unsubscribe from this group, send email to 
>> sqlalchemy+unsubscr...@googlegroups.com.
>> For more options, visit this group at 
>> http://groups.google.com/group/sqlalchemy?hl=en.
>>
> 

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.

Reply via email to