On 8/6/15 5:31 PM, Jinghui Niu wrote:
I know you can set this constraint if you are directly dealing with sqlite3, but how can I achieve this database level setting from within sqlalchemy?

The documentation reads:

    "Note that these clauses are not supported on SQLite, and require
    InnoDB tables when used with MySQL. They may also not be supported
    on other databases."


So is there a way to turn this feature on from within sqlalchemy? Thanks.
that documentation is probably out of date. The ON DELETE CASCADE directive will emit on SQLite like on any other backend. You would need to enable foreign key support on a per-connection basis for sqlite3 in order for them to take effect:

http://docs.sqlalchemy.org/en/rel_1_0/dialects/sqlite.html#foreign-key-support




--
You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+unsubscr...@googlegroups.com <mailto:sqlalchemy+unsubscr...@googlegroups.com>. To post to this group, send email to sqlalchemy@googlegroups.com <mailto:sqlalchemy@googlegroups.com>.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to