Telegram Group & Telegram Channel
🖥 py-pglite — PostgreSQL без установки, тестируй как с SQLite!

py-pglite — обёртка PGlite для Python, позволяющая запускать настоящую базу PostgreSQL прямо при тестах. Без Docker, без настройки — просто импортируй и работай.

📌 Почему это круто:
- 🧪 Ноль конфигурации: никакого Postgres и Docker, только Python
- Молниеносный старт: 2–3 с против 30–60 с на традиционные подходы :contentReference[oaicite:2]{index=2}
- 🔐 Изолированные базы: новая база для каждого теста — чисто и безопасно
- 🏗️ Реальный Postgres: работает с JSONB, массивами, оконными функциями
- 🔌 Совместимость: SQLAlchemy, Django, psycopg, asyncpg — любая связка :contentReference[oaicite:3]{index=3}

💡 Примеры установки:

pip install py-pglite
pip install py-pglite[sqlalchemy] # SQLAlchemy/SQLModel
pip install py-pglite[django] # Django + pytest-django
pip install py-pglite[asyncpg] # Асинхронный клиент
pip install py-pglite[all] # Всё сразу


🔧 Пример (SQLAlchemy)


python
def test_sqlalchemy_just_works(pglite_session):
user = User(name="Alice")
pglite_session.add(user)
pglite_session.commit()
assert user.id is not None


py‑pglite — идеальный инструмент для unit- и интеграционных тестов, где нужен настоящий Postgres, но без всей админской рутины.

Полноценный PostgreSQL — без его тяжеловесности.


Github

@pythonl

#python #sql #PostgreSQL #opensource
Please open Telegram to view this post
VIEW IN TELEGRAM



tg-me.com/pythonl/4878
Create:
Last Update:

🖥 py-pglite — PostgreSQL без установки, тестируй как с SQLite!

py-pglite — обёртка PGlite для Python, позволяющая запускать настоящую базу PostgreSQL прямо при тестах. Без Docker, без настройки — просто импортируй и работай.

📌 Почему это круто:
- 🧪 Ноль конфигурации: никакого Postgres и Docker, только Python
- Молниеносный старт: 2–3 с против 30–60 с на традиционные подходы :contentReference[oaicite:2]{index=2}
- 🔐 Изолированные базы: новая база для каждого теста — чисто и безопасно
- 🏗️ Реальный Postgres: работает с JSONB, массивами, оконными функциями
- 🔌 Совместимость: SQLAlchemy, Django, psycopg, asyncpg — любая связка :contentReference[oaicite:3]{index=3}

💡 Примеры установки:


pip install py-pglite
pip install py-pglite[sqlalchemy] # SQLAlchemy/SQLModel
pip install py-pglite[django] # Django + pytest-django
pip install py-pglite[asyncpg] # Асинхронный клиент
pip install py-pglite[all] # Всё сразу


🔧 Пример (SQLAlchemy)


python
def test_sqlalchemy_just_works(pglite_session):
user = User(name="Alice")
pglite_session.add(user)
pglite_session.commit()
assert user.id is not None


py‑pglite — идеальный инструмент для unit- и интеграционных тестов, где нужен настоящий Postgres, но без всей админской рутины.

Полноценный PostgreSQL — без его тяжеловесности.


Github

@pythonl

#python #sql #PostgreSQL #opensource

BY Python/ django




Share with your friend now:
tg-me.com/pythonl/4878

View MORE
Open in Telegram


Python django Telegram | DID YOU KNOW?

Date: |

A Telegram spokesman declined to comment on the bond issue or the amount of the debt the company has due. The spokesman said Telegram’s equipment and bandwidth costs are growing because it has consistently posted more than 40% year-to-year growth in users.

Telegram Auto-Delete Messages in Any Chat

Some messages aren’t supposed to last forever. There are some Telegram groups and conversations where it’s best if messages are automatically deleted in a day or a week. Here’s how to auto-delete messages in any Telegram chat. You can enable the auto-delete feature on a per-chat basis. It works for both one-on-one conversations and group chats. Previously, you needed to use the Secret Chat feature to automatically delete messages after a set time. At the time of writing, you can choose to automatically delete messages after a day or a week. Telegram starts the timer once they are sent, not after they are read. This won’t affect the messages that were sent before enabling the feature.

Python django from in


Telegram Python/ django
FROM USA