-
-
Notifications
You must be signed in to change notification settings - Fork 133
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SQLite connection options #581
base: main
Are you sure you want to change the base?
Conversation
The `3.2.x` versions don't have a lot of the code that `5.1.x` uses for this.
Newer Django will set this for us, but it won't matter if it is disabled twice.
TypeError: 'transaction_mode' is an invalid keyword argument for Connection()
TypeError: 'init_command' is an invalid keyword argument for Connection()
Oops. It helps to have the resulting connection.
A possible future improvement would be to define a map of which keys Connection accepts. Right now, this is removing keys after Connection fails because of an unknown key. This could be automated by using try and removing a key each time the exception is caught.
Less manual maintenance as versions change is a win!
I didn't pay close enough attention to the try grammar.
Fixed up the try syntax too. I really dislike try, but it's almost mandatory in Python.
@meeb Is there a good reason Django is pinned at |
3.2 is the latest version that works with the background tasks module which is basically now unmaintained. Upgrading past 3.2 requires replacing the tasks system. |
I'd much rather wait for the tasks system to be worked on and Django upgraded to 5.1 to natively support these sorts of features rather than backport this. |
Did you have something in mind for a replacement? APScheduler with a Django implementation looked interesting, but I haven't used it before. I also saw a |
I was porting it to Celery at one point, however that got delayed as I started waiting for native background workers (Django DEP14) to merge into main. |
Are you planning to wait for the implementation to be completed? It looks like there is enough support for redis or sqlite task storage already. |
Yeah I didn't particularly want to implement it against an in-flux reference implementation then have to make further changes once it was mainline. |
Configure the connection
PRAGMA
values from settings.It's now less messy.
However, the
DatabaseWrapper
is not exactly fun to work with.I've made changes to hopefully make it as easy to maintain as I can.