Take the 2-minute tour ×

I want to define a specific schema for a 'model' using flask-sqlalchemy. When you create a table object in sqlalchemy itself it has a parameter to pass for schema name.

How do I do this in flask-sqlalchemy?

share|improve this question
add comment

1 Answer

up vote 7 down vote accepted

When you define your model class use:

__table_args__ = {"schema":"schema_name"}

maybe it will save someone else some hunting.

share|improve this answer
Thank you! You indeed saved me having to ask the question. –  Lyndsy Simon Dec 20 '12 at 21:15
add comment

Your Answer


