Git Product home page Git Product logo

Comments (6)

samuelcolvin avatar samuelcolvin commented on July 17, 2024 1

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.

asvetlov avatar asvetlov commented on July 17, 2024

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.

samuelcolvin avatar samuelcolvin commented on July 17, 2024

Short answer for now is probably "use another database" :-(.

Closing this as it's not relevant to aiohttp-devtools.

from aiohttp-devtools.

flip111 avatar flip111 commented on July 17, 2024

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.

asvetlov avatar asvetlov commented on July 17, 2024

aiosqlite is maybe the library you are looking for but I personally never used the project.

from aiohttp-devtools.

flip111 avatar flip111 commented on July 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.