insolite / graphene-peewee-async

Graphene peewee-async integration
37 stars 9 forks source link

peewee 3.x support #12

Closed chiaki64 closed 5 years ago

chiaki64 commented 5 years ago

For some reasons i need peewee 3.x support, but from the changes from 2.x to 3.x, some functions has been removed and changed.

So i created a new branch to support the peewee 3.x, and 2.x version support is deprecated. This is the branch peewee_3_support branch.

Some solutions are dirty and may have the better way to fix, like InsertQuery.return_id_list() method has been replaced by using _WriteQuery.returning(), but in the peewee-async 0.6.0alpha version the returning will only return the last affected id, so i patch the peewee_async.insert function to return id list in CreateManyMutation.mutate function, this is not elegant and needs refactor.

Can you create a new branch like peewee_3_support for storage code that support peewee 3.x version? I want to create a pr for this branch.

Thank you!

insolite commented 5 years ago

Thank you for such contribution so far! And sorry for such delay. I've even missed the fact that peewee-async already supports peewee>=3. Well, straight to the point... In general the migration to peewee>=3 seems to be working. @chiaki64 I've looked at your branch and came up with a few more fixes mostly related to backrefs (that stuff just wasn't covered by tests). Also I've refactored a monkey-patch for insert function so now it's just a few low-level calls. I believe it's a bug so I've also created an issue (05bit/peewee-async#118) for it. So, @chiaki64, if it's possible and still actual for you, please give a quick look at the changes (#13). Then I'll push them to the main branch and release a major version.

insolite commented 5 years ago

Well, I merged it so now it's v3.0.0. Feel free to report any suggestions/bugs. Thanks!