alisaifee / limits

Rate limiting using various strategies and storage backends such as redis & memcached
https://limits.readthedocs.org
MIT License
410 stars 57 forks source link

SQLite storage backend #227

Open tresoldi opened 1 month ago

tresoldi commented 1 month ago

I wrote an SQLite backend for a project of mine, using the standard sqlite3 library. It is a thread-safe as I could make it, as expected it can work both in memory and from a file. I wonder if you would be interested in a PR to integrate it to the project (it seems the idea was never discussed, at least from past issues).

The full source code is in this gist: https://gist.github.com/tresoldi/3d8c8db0ca71b7bb9bae9d9a64828f09

mconigliaro commented 1 week ago

Even better would be a generic SQL backend using something like sqlalchemy so we can pick whichever SQL backend we want. I think this has come up before. I'd be curious to try something like this in my dev environment.