pudo / dataset

Easy-to-use data handling for SQL data stores with support for implicit table creation, bulk loading, and transactions.
https://dataset.readthedocs.org/
MIT License
4.78k stars 298 forks source link

Implement automatic creation of DBs #300

Closed abmyii closed 4 years ago

abmyii commented 5 years ago

This PR implements automatic creation of DB's (for PostgreSQL in my case - I'm aware that SQLite DB's are already automatically created and wanted to have similar functionality for other DBs).

I'm not sure if it is right for dataset or not. If not, I'll implement it on a project-level basis.

NOTE: this adds another required package sqlalchemy_utils.

abmyii commented 5 years ago

Sorry about this, I've made a bit of a mess by making the PR use the master branch rather than a new branch and then merging changes into it. PR 301 is also merged into this. Hopefully you'll know how to solve this.

pudo commented 4 years ago

Is this really a big need? I'm super reluctant to expand the scope of dataset into doing ever more things, especially ones that are going to diverge between databases. Maybe it would make sense to start a new package for database management?

abmyii commented 4 years ago

Firstly apologies about the merge conflicts as I, in my ignorance of git with regards to collaborating, didn't realise that working on a PR branch would cause this to happen.

As for the complexity, then I think most of it arises from the conflict and the actual automatic creation code is very simple. I think it is within the scope of dataset since it already does create non-existant SQLite databases and therefore one would expect that it would work identically with any other database.

pudo commented 4 years ago

Unfortunately, my intuition is to reject this simply to avoid incurring the scope of database management. Would be keen to think what @stefanw & others think.

abmyii commented 4 years ago

Sure, I'll maintain this in my own fork for now and we'll see how it goes.

pudo commented 4 years ago

Ok :$

abmyii commented 4 years ago

:$

?