I am trying to use the strings in a list as the columns names in an sqllite database I am creating. I currently have the following code (using sqlalchemy):
db = create_engine('sqlite:///strings.db')
db.echo = False
metadata = MetaData(db)
lang_array = []
lang_array.append(Column("id", Integer, primary_key = True))
for lang in lang_keys:
lang_array.append(Column(lang, String))
strings = Table("strings", metadata, lang_array)
Where lang_keys is a list of strings. Is it possible to pass a list in the Table method like above? I am getting the error AttributeError: 'list' object has no attribute 'schema. What am I doing wrong here?