Closed kapily closed 3 years ago
I'm a little bit against this feature: it adds another syntax to the library, which is already getting confusing. Much of the point of dataset
is to allow implicit schema creation. If the table layout is to be well-defined, then that's a strong hint that you might want to use SQLAlchemy proper. Otherwise, the next addition is going to be foreign key constraints and defining relationship mappings - then we've gone full circle.
Proposal: if there are two other people who chime in here and say they really really really want it, we'll do it. But then it also needs to be comprehensively documented.
This PR adds a succinct way for users to create a table with:
I've frequently used this helper function in my projects because I've wanted to explicitly specify the field types and reduces the amount of code needed to create a table with the columns and indicies that I wanted.
This example in the comments best illustrates this.
With this PR, you can now create a table like this:
Instead of: