Skip to content

Fixed code example of type usage docs#157

Merged
chandr-andr merged 7 commits into
psqlpy-python:mainfrom
recloud-dev:fix/docs
Oct 10, 2025
Merged

Fixed code example of type usage docs#157
chandr-andr merged 7 commits into
psqlpy-python:mainfrom
recloud-dev:fix/docs

Conversation

@recloud-dev

Copy link
Copy Markdown

No description provided.

@chandr-andr

Copy link
Copy Markdown
Member

@recloud-dev Hello!
Thank you very much for your contribution.
What do you think about changing this

connection = await db_pool.connection()
await connection.execute(...)
await connection.close()

to this variant:

async with db_pool.acquire() as conn:
	await conn.execute(...)

Usually, it's better to let the context manager do all the work.

@recloud-dev

recloud-dev commented Oct 9, 2025

Copy link
Copy Markdown
Author

Yep, it's better this way, I'll make a replacement.

@chandr-andr chandr-andr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@chandr-andr chandr-andr merged commit 2549109 into psqlpy-python:main Oct 10, 2025
42 of 45 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants