goodrobots / maverick-api

API backend for maverick-web
MIT License
8 stars 5 forks source link

to use an ORM? #222

Open SamuelDudley opened 4 years ago

SamuelDudley commented 4 years ago

Thinking longer term:

It's likely that we will need a reflection in the graphql schema to a database.... There are options out there such as https://github.com/graphql-python/graphene-sqlalchemy however:

  1. the ORM does not support async DB operations
  2. the ORM drives the graphql schema (uses graphene https://graphene-python.org/)

When last rewriting -api (years ago now :S ) graphene was lagging quite a way behind graphql-core-next and so -api was written without the use of graphene. Today graphene uses graphql-core-next and offers some nice convenience functions and a clear way to build graphql queries from an ORM.

Things to think about:

Lots of questions and not a lot of answers at this stage...

SamuelDudley commented 4 years ago

For the moment I will add tortoise-orm with the sqlite backend and use that for a user database and other info we wish to persist. Not buying into this as a solution, but I wont know what the problems are unless I try.

SamuelDudley commented 4 years ago

Async mongo odm https://github.com/Scille/umongo

SamuelDudley commented 4 years ago

https://edgedb.com/docs <- graphql support, async, nosql, built on postgres