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 (https://github.com/wey-gu/py-pglite)



#python #sql #PostgreSQL #opensource

@Python_Community_ru



tg-me.com/Python_Community_ru/2658
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 (https://github.com/wey-gu/py-pglite)



#python #sql #PostgreSQL #opensource

@Python_Community_ru

BY Python Community




Share with your friend now:
tg-me.com/Python_Community_ru/2658

View MORE
Open in Telegram


Python Community Telegram | DID YOU KNOW?

Date: |

How to Invest in Bitcoin?

Like a stock, you can buy and hold Bitcoin as an investment. You can even now do so in special retirement accounts called Bitcoin IRAs. No matter where you choose to hold your Bitcoin, people’s philosophies on how to invest it vary: Some buy and hold long term, some buy and aim to sell after a price rally, and others bet on its price decreasing. Bitcoin’s price over time has experienced big price swings, going as low as $5,165 and as high as $28,990 in 2020 alone. “I think in some places, people might be using Bitcoin to pay for things, but the truth is that it’s an asset that looks like it’s going to be increasing in value relatively quickly for some time,” Marquez says. “So why would you sell something that’s going to be worth so much more next year than it is today? The majority of people that hold it are long-term investors.”

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.

Python Community from fr


Telegram Python Community
FROM USA