When I run print CreateTable(question)
after the following code I get an error, and it is because it is not compiling correctly because of ARRAY
which is something specific to postgres. How do I get it to compile the correct CREATE
script? Where do I enter dialect-related compiling information?
from sqlalchemy import Table, Column, Integer, String, ForeignKey, MetaData
from sqlalchemy.dialects.postgresql import ARRAY
from sqlalchemy.schema import CreateTable
metadata=MetaData()
user = Table('user', metadata,
Column('id', Integer, primary_key=True)
)
question = Table('question', metadata,
Column('id', Integer, primary_key=True),
Column('description', String),
Column('answers', ARRAY(String))
)