On Oct 10, 2014, at 10:30 AM, Eren Gölge <erengo...@gmail.com> wrote:

> I try to do basic ETL job with SQLalchemy but it always enforces relations 
> between tables.

SQLAlchemy doesn't do anything like that.  I think you are referring to the 
FOREIGN KEY constraints that are within your database.


> I only like to copy the tables with the raw data inside without the 
> considration of table relations. How can I drop all those relations from the 
> DB metadata and copy the tables.

You can drop or possibly temporarily disable FOREIGN KEY constraints on the 
database side.  How this is done depends on the kind of database you're using.  
For example, with MySQL, it's very easy, use FOREIGN_KEY_CHECKS: 
http://www.sqlines.com/mysql/set_foreign_key_checks.


> In addition I also need to create tables if they are not exist. The use of 
> create_all() function does not meet my needs because of the aforementioned 
> problems.

I don't understand how an existing foreign key constraint interferes with the 
processing of a CREATE TABLE statement, you'd have to illustrate a specific 
example.

-- 
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