Closed inactivist closed 3 years ago
Ah, I see my mistake, I failed to create the column via table.create_column("created_on", db.types.datetime)
prior to calling create_index
(obviously, can't create an index on a column that's not yet been defined.)
(dataset version 1.4.1, Python3.8)
I'm new to dataset, so I have a usage question. What is the proper way to create additional index on a table, before inserting data? I haven't found any documentation that shows how to do this.
Per https://github.com/pudo/dataset/issues/293#issuecomment-573317528, I should be able to create indexes immediately after
db.create_table()
call.If I call
table.create_index()
immediately afterdb.create_table()
, DatasetException("Table has not been created yet.") is raised.I'm looking for a working example, if possible.
Example code: