integration with orm edgy #255
Replies: 3 comments 10 replies
-
@YuriFontella hi. Thank you for this. The reason for this it's because the databasez returns a type SQLA Row and that it's not serializable 🙂 Does this make sense? The best way is by using the get() where you can filter by whatever you want or if you want to use the databasez like you are doing, you need to convert the result into a serializable format. Edgy in the docs explains how to use the queries 🙂 |
Beta Was this translation helpful? Give feedback.
-
I understand that most database adapters do not explicitly return a list or a dict and that web frameworkers need this to send the data correctly in the request. But I was looking for something like https://www.encode.io/databases without an orm behind it, it seems like an obsolete project. Creating a new list with the result seems a little tiring to me. |
Beta Was this translation helpful? Give feedback.
-
Oh thank you very much @YuriFontella i do appreciate it. How is Esmerald so far? Well Databasez was forked from databases to serve other use cases and continue from there. It was necessary. If you want to return a list of results with Esmerald you can change the return signature to be List[User] and return the users from the queryset and automatically Esmerald handles the response for you. The query data that returns from that is not pydantic oriented, it's simple python objects. If you are looking for something like that, you can use Saffier instead. It's basically a more pure orm than edgy. Edgy leverages pydantic at the core basically. I'm not sure if I'm answering you to be honest and If not, I apologize |
Beta Was this translation helpful? Give feedback.
-
Hello,
I'm trying emerald and edgy, and I have this question about data return.
Using the orm function to return data in the route, data serialization works.
When I directly use the fetch_one function with a raw query, it is unable to send the data in the request.
I don't know exactly if this is a problem, and whether it applies to edgy or emerald.
I may be doing something wrong, I appreciate any information.
Thanks.
Beta Was this translation helpful? Give feedback.
All reactions