django-pgschemas icon indicating copy to clipboard operation
django-pgschemas copied to clipboard

Refactoring for v0.99

Open lorinkoz opened this issue 2 years ago • 2 comments

Refactor

  • [x] Use contextvars instead of asgiref.Local
  • [x] Move domain-related handling to routing module.
  • [ ] Make domain-related handling optional, together with all the related TENANTS settings.
  • [x] Use TenantModel.routing
  • [ ] Implement middleware for session routing and headers routing
  • [ ] Move to pytest !!
  • [ ] Level up the typing game

more to come...

lorinkoz avatar Nov 14 '23 06:11 lorinkoz

Looking forward to this! 😃

ZipBrandon avatar Apr 09 '24 12:04 ZipBrandon

Sorry for the looooong delay. Life (not Zelda this time) is keeping me busy!

lorinkoz avatar Apr 09 '24 12:04 lorinkoz

@lorinkoz Cheers!

ZipBrandon avatar Aug 26 '24 13:08 ZipBrandon

Thanks!

Looking forward to this! 😃

btw what was specifically interesting to you from the TODO list?

lorinkoz avatar Aug 26 '24 14:08 lorinkoz

Honestly I'll have to investigate! Are you able to summarize on the release notes since most things went to master?

I had my own implementation of Headers for routing because I use Django as a backend and communicate to it from the frontend over an internal route. I'll move to your supported format.

ZipBrandon avatar Aug 26 '24 14:08 ZipBrandon

Ah, interesting.

Are you able to summarize on the release notes since most things went to master?

I will, still figuring out how to do it because there are quite some breaking changes.

I had my own implementation of Headers

Let me ask you here. What were you putting in the header? The schema name of the tenant, the id, or some other unique data?

lorinkoz avatar Aug 26 '24 14:08 lorinkoz

I am putting the tenant PK, a UUID, in the header.

ZipBrandon avatar Aug 26 '24 18:08 ZipBrandon

Thank you.

So you'd say this should work for you without further configuration?

lorinkoz avatar Aug 26 '24 19:08 lorinkoz

@ZipBrandon if one of these days you'd like to give a try to the v1 candidate, this is the place to start: https://github.com/lorinkoz/django-pgschemas/discussions/277

lorinkoz avatar Aug 27 '24 19:08 lorinkoz