Comments (6)
Unlike "batteries included" solutions like django, aiohttp doesn't make any constrains on what database you might like to use. There are therefore a large number of possible database backends, it's obviously impossible for aiohttp-devtools to provide a template for every single one.
To use another database backend, you'll likely want to add on_startup
and on_cleanup
methods to create an close your database connections. This is not specific to aiohttp-devtools, it's stardard aiohttp and I therefore recommend you read the server section of docs.aiohttp.org.
from aiohttp-devtools.
aiohttp-devtools is not a database driver :)
On other hand sqlite has no asynchronous API. The best what you can do is wrapping every DB call into run_in_executor
. aioodbc
is built using the same approach.
Technically you can connect to sqlite database using aioodbc driver but it looks like huge over-engineering.
from aiohttp-devtools.
Short answer for now is probably "use another database" :-(.
Closing this as it's not relevant to aiohttp-devtools.
from aiohttp-devtools.
aiohttp-devtools seems to be opinionated on postgres. I'm only asking which files do i need to modify to "use another database".
As for the technical discussion which database is suitable .. thanks for the information on sqlite and asynchronous API. I did some reading and i would like to try this library https://github.com/jreese/aiosqlite or this one https://github.com/RazerM/sqlalchemy_aio
from aiohttp-devtools.
aiosqlite is maybe the library you are looking for but I personally never used the project.
from aiohttp-devtools.
That's fine .. i can figure out some way to work with the database. But what should i keep from the default aiohttp-devtools template and what should i modify? You mentioned aioodbc
as another option .. but this one is also not in the interactive choice when i run adev start
. Perhaps it's better to start with the none database?
from aiohttp-devtools.
Related Issues (20)
- [feature-request] Adding additional parameters HOT 2
- Reload on additional file changes HOT 2
- No graceful shutdown when CTRL-C HOT 3
- Auto reload get triggered by Emacs tmp files HOT 2
- Incorrect behavior if __name__ == '__main__': sys.exit(main()) HOT 2
- Remove/enable --boxed
- As of 3.10, the *loop* parameter was removed from Event HOT 2
- Not working with python 3.10 version HOT 2
- v1.0 broken (missing JS)
- How do I use aiohttp-devtools with the PyCharm debugger? HOT 2
- runserver doesn't respect host setting HOT 3
- async_generator object has no attribute lock HOT 3
- logging / log format HOT 5
- Looking to wrong server to find static files. HOT 2
- Cleanup context is not always run HOT 7
- Cleanup context is not run on reload on Windows HOT 17
- Host setting not respected HOT 2
- Tests leave python processes and an open port behind
- Let's put `aiohttp-devtools` under the `aio-libs` org on PyPI HOT 5
- Import module order issue HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aiohttp-devtools.