- Notifications
You must be signed in to change notification settings - Fork39
Open
Description
-- name: get_plot_lists :manyWITH grouped_listsAS (SELECTl.id,l.name,l.created_at, array_agg(p2l.cadastral_number)AS cadastral_numbersFROMpublic.plot_listsAS lLEFT JOINpublic.land_plot2plot_listAS p2lONl.id=p2l.plot_list_idGROUP BYl.id,l.name)SELECTgl.name,gl.cadastral_numbers, (SELECTCOUNT(*)FROMpublic.plot_lists)AS totalFROM grouped_lists glORDER BYgl.created_atLIMIT @pagination_limit OFFSET (@page-1)* @pagination_limit;
This sql query gives next python function:
asyncdefget_plot_lists(self,*,-page:Optional[Any],pagination_limit:int)->AsyncIterator[get_plot_listsRow]:result=awaitself._conn.stream(sqlalchemy.text(GET_PLOT_LISTS), {"p1":-page,"p2":pagination_limit})asyncforrowinresult:yieldget_plot_listsRow(name=row[0],cadastral_numbers=row[1],total=row[2], )
'page' arg generated with '-' as prefix.
-> % sqlc version
v1.28.0plugins:
- name: py
wasm:
url:https://downloads.sqlc.dev/plugin/sqlc-gen-python_1.3.0.wasm
sha256: fbedae96b5ecae2380a70fb5b925fd4bff58a6cfb1f3140375d098fbab7b3a3c
Metadata
Metadata
Assignees
Labels
No labels