Replies: 1 comment
-
I actually came up with this that seems to work. Is this the best way? @mayim.query(
"""
INSERT INTO blobs (key, data)
VALUES ($key, $data)
"""
)
async def insert(self, key: str, data: dict):
import psycopg.types.json as js
query = self.get_query("insert")
await self.execute(query, params={"key": key, "data": js.Jsonb(data)}) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi. I'm brand new to Mayim and was wondering how one might insert data into PostgreSQL JSONB columns.
Beta Was this translation helpful? Give feedback.
All reactions