Questions tagged [gino]

GINO is a SQLAlchemy based asynchronous ORM for Python.

GINO is a SQLAlchemy based asynchronous ORM for Python.

Features

  • Robust SQLAlchemy-asyncpg bi-translator with no hard hack.

  • Asynchronous SQLAlchemy-alike engine and connection.

  • Asynchronous dialect API.

  • Asynchronous-friendly CRUD objective models

  • Well-considered contextual connection and transaction management

  • Reusing native SQLAlchemy core to build queries with grammar sugars

  • Support SQLAlchemy ecosystem, e.g. Alembic for migration

17 questions
3
votes
1 answer

Acquiring pool connections in Python Gino (async)

I'm using Postgres, Python3.7 with asyncio + asyncpg + gino (ORM-ish) + aiohttp (routing, web responses). I created a small postgres table users in my database testdb and inserted a single row: testdb=# select * from users; id |…
lollercoaster
  • 15,969
  • 35
  • 115
  • 173
3
votes
1 answer

How to insert an element into a nested JSONB array with SQLAlchemy on postgres

I've seen a wide variety of good answers on how to store JSONB in postgres, but as of Postgres 9.5, we are now able to insert into the existing JSONB array without updating the data in the column. None of the material I can find has this documented…
Michael Draper
  • 1,928
  • 3
  • 18
  • 24
2
votes
1 answer

How to filter by ILIKE word in gino with Postgres

I want to implement a suggest search in my project. I use a gino library and wondering how to code a "like" filter in gino code? Basically i need to write this sql statement in gino code: SELECT id FROM category WHERE category.name ILIKE '%query%'…
navy
  • 159
  • 9
2
votes
1 answer

How to convert raw SQL query to gino ORM query?

I have this table in a postgreSQL database with postGIS extension installed and enabled. Table "public.crime_data" Column | Type | Collation | Nullable | Default …
Diptangsu Goswami
  • 5,554
  • 3
  • 25
  • 36
1
vote
0 answers

PyCharm exit code -1073741819

I'm using PyChram version 2023.2, Windows 10 and PostgreSQL 15 (SQLAlchemy 1.3.24 and gino 1.0.1 to connect) I get the error Process finished with exit code -1073741819 (0xC0000005) when I try to run the code in debug mode Ctrl + F5. How can I fix…
Sonel
  • 11
  • 1
1
vote
0 answers

gino.exceptions.UninitializedError: Gino engine is not initialized

I've created a telegram bot with gino. When I start this bot on my computer everything work fine. But when I try to start it on AWS server, I get this error: gino.exceptions.UninitializedError: Gino engine is not initialized. The error in this part…
kaucap
  • 77
  • 5
1
vote
0 answers

Pyinstaller package not found even after a explicit hidden import (gino-starlette)

I've been trying to package an application which requires gino-starlette. I've tried including the requirement as a hidden import with command pyinstaller --hidden-import gino_starlette --hidden-import gino.ext --noconfirm windows_runner.py…
1
vote
1 answer

I'm getting a weird error trying to run tests using pytest for FastAPI + Gino app

Getting a weird error in tests. I probably did something wrong but I don't know what exactly. client = @pytest.fixture @pytest.mark.anyio async def user(client): …
koss
  • 11
  • 1
  • 2
1
vote
0 answers

Gino + SQLAlchecmy + Postgres How reload model?

Now i use # Get user usr = await UserModel.get(1) # some updates like await UserModel.update.values(name="Test").apply() # then i need reload usr usr = await usr.get(usr.id) But i think that bad way :-( May be some one know better way to reload…
1
vote
1 answer

FastAPI & GINO can't get all rows from table in db

I am stuck into a problem with GINO. I can get a one row from my table called templates, so in the other route i want to get all rows from table. Here you can see my view for get one record from db ant it works…
Lilly
  • 59
  • 1
  • 1
  • 9
0
votes
0 answers

Is it possible to issue an update/insert statement RETURNING joined in columns in sqlalchemy/gino?

I have a Users and a Tags table. The column that I want to replace after updating the Tags table is Tags.created_by_user_id with Users.hash_id left joined in. class Tag(BaseClass): __tablename__ = "tags" ... created_by_user_id:…
Hyperion
  • 1
  • 2
0
votes
0 answers

Can I use Gino[starlette] with SQLite?

I'm trying to make the Gino mock, but I keep seeing the error gino.exceptions.UninitializedError: Gino engine is not initialized. My code is formed like this: # __init__.py @functools.lru_cache def get_db_service(): db =…
Plaoo
  • 417
  • 3
  • 19
0
votes
1 answer

How to filter by date.attribute in gino with Postgres

I try to filter users by month using gino cur_month_users = await User.query.where(User.birth_date.month==12).gino.all() but it does't work cus: AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'month' my simple…
fromSelect
  • 23
  • 4
0
votes
1 answer

Add table columns to select without adding it to select_from

I have a prepared function in the database, which I want to call using Gino. This function has a return type equal to one of the tables, that is created using declarative. What I try to do is: select(MyModel).select_from(func.my_function); The…
zefciu
  • 1,967
  • 2
  • 17
  • 39
0
votes
1 answer

Save an object using Celery and Gino

I have the following pipeline Event model (based on Gino 'db' object): class Event(db.Model): __tablename__ = "events" id = db.Column(db.BigInteger(), primary_key=True) request_timestamp = db.Column(db.DateTime(), nullable=False) …
1
2