#sqlalchemy

2025-06-12

It's been a while since I've posted an update for Rack Root, but I've actually made some progress on it lately.

I've finished my refactor to use SQLAlchemy for the database connections and also (finally) figured out how I want to join tables together and relate things.

I also changed some API endpoints. For example, if you look for /network/$id/gateway and there's no gateway, you get a 404. I also changed the UX around gateways. When you make a new network, there's no gateway assigned, so that part of the page has a green + icon. When you set a gateway, that icon is now a red delete icon. Those update the field and icon dynamically without having to refresh the whole page.

The new networks page also will look at the result and see if you got an HTTP 201. If so, you get redirected to the new page. Else, you get an error message. I'm not sure if I want to add more detail to that, it would require the frontend to parse and guess what went wrong. Maybe that's an assignment for another day.

Finally, there's a new Delete network button on the network detail page.

#rackroot #homelab #vuetify #fastapi #sqlalchemy #frontend #backend #fullstack #pytest

Input form showing an error message with purposefully bad network data. For example, this one has a subnet mask of 932.New network detail page showing a green plus sign in the gateway area and a blank value there.Network detail page showing a red trash can icon to delete a gateway and a gateway address that's populated.
2025-05-27

Anyone know how to do:

SELECT array(SELECT ...) AS arr, ...

with #SQLAlchemy? Or do I need to use text()? #Python #PostgreSQL

2025-05-24

I think I finally have my SQLModel to SQLAlchemy refactor completed for Rack Root. As of now, I at least have all of my tests passing and typos worked out. I know I need to add some more join statements, but I'll do those as I come across them.

I still have a little bit of cleanup to do in removing commented code, fixing comments, organizing imports, and syncing this back to the main branch, but the hard part is done.

Then I can finally get back to the front end work. I've been on the backend side of things for what feels like months.

#sqlalchemy #fastapi #webdev #backend #databases #opensource #rackroot

2025-05-21

⚙️Are you looking for an #online #database #modeling #tool with #SQL generation?

With the latest updates (e.g. modeling of #association #classes), BESSER is your ideal tool to #design and #generate your databases in many different "flavours" :

☑️ #SQLLite

☑️ #PostgresQL

☑️ #MySQL

☑️ #MariaDB

☑️ #MSSQLServer

☑️ and even #SQLAlchemy

Ready to give it a try? No installation required! ➡️ editor.besser-pearl.org/

Did I already mention is completely 🆓 and #opensource?

2025-05-14

I am defining a #SQLAlchemy ORM and wish to use #JSON as column type. I can use the generic JSON type or the MS SQL Server-specific JSON type.
Whether I use the generic or the specific column type, values seem limited to 1000 characters (ODBC complains that larger contents would be truncated).
I try `mapped_column(JSON(4000))` in ORM definitions, but that does not seem to make any difference in practice.

What is the actual field width of this column type? Can I somehow change it (larger)?

2025-05-10

FastAPI + Keycloak: Простая и безопасная авторизация в веб-приложении на примере реального проекта

Keycloak - это мощная open-source платформа для аутентификации и авторизации, которую используют даже банки и крупные корпоративные клиенты для защиты своих приложений и данных. В статье на реальном примере (FastAPI + Python) простым языком объясню, как Keycloak помогает упростить управление доступом и почему его принципы универсальны для любого бэкенда, независимо от выбранного языка программирования

habr.com/ru/companies/amvera/a

#keycloak #fastapi #авторизация #базы_данных #python #keycloak_fastapi #вебразработка #sqlalchemy_20 #sqlalchemy #javascript

OpenLink Softwareopenlink
2025-04-25

Boom!

In addition to our servers for , , , and , we now have one for ADO.NET—bringing .NET runtime support into the mix.

At this point, we’ve covered all the major protocols needed to build data source–agnostic AI Agents via MCP.

Github Repo:

github.com/OpenLinkSoftware/mc

2025-03-18

I have a #Python codebase using #sqlalchemy Core -- *NOT* ORM -- for its data layer, and I'm currently not happy with the way it's doing data for testing. Who has a pattern for this that they actually like?

I already have ephemeral per-test-function isolation of the database, so that's taken care of.

If this were ORM I'd just use something like factory-boy, but the fact that it's Core and doesn't really map neatly to objects the way ORM stuff does rules that out. I think ideally what I'd like is some sort of declarative JSON file format or whatever that lets me provide a mapping of table names to lists of rows to insert into them, and then a pytest fixture that lets me say "load that JSON file for this test". Has anyone written something like that? Do I get to go write my own?

洪 民憙 (Hong Minhee)hongminhee@hackers.pub
2025-03-17

애플리케이션 개발 측면에서 본 Drizzle ORM 대 Kysely 비교

hackers.pub/@hongminhee/2025/d

2025-03-15

Создание анонимного чата в Telegram: Бот с MiniApp интерфейсом. Часть 1 — Бэкенд на FastAPI, Aiogram, Redis и Centrifugo

Это первая статья из цикла, посвященного разработке телеграм-бота с MiniApp для случайных чатов. В этой части мы сосредоточимся на создании бэкенда, используя современные технологии: FastAPI для разработки API, Redis для хранения данных в реальном времени и Centrifugo для обеспечения мгновенного взаимодействия между пользователями. Сегодня мы подробно разберем архитектуру проекта, настройку серверов и реализацию логики бота. В следующей статье мы переключимся на фронтенд и займемся разработкой MiniApp с использованием фреймворка Vue.js . Это позволит создать интуитивно понятный интерфейс для пользователей, где они смогут настраивать параметры поиска собеседника и общаться в режиме реального времени (Real time).

habr.com/ru/companies/amvera/a

#fastapi #telegram_mini_app #telegram_webapp #python #centrifugo #centrifugo_v6 #sqlalchemy #redis #redis_python #бэкенд

2025-03-11

LitestarCatsCV. Тренируемся на кошках. Реализация API и работа с данными

Что вас ждёт: Если в первой части мы заложили фундамент проекта (выбор инструментов, настройка окружения и структура), то здесь мы превратим этот каркас в полноценное API для управления резюме кошек (или людей — как вам ближе). Мы подключим базу данных, добавим тесты, настроим миграции и даже проверим всё в действии. К концу статьи у вас будет рабочее API, которое можно потрогать руками (или лапками 🐾). Полный код доступен на GitHub — ссылка в конце!

habr.com/ru/companies/ntechlab

#python #python3 #litestar #alembic #sqlalchemy #orm #pytest #asyncpg

2025-03-04

Dear #LazyWeb and friends,

I have a lovely normalised database and one column, when fetched back from the database, can have multiple values. I have the standard 3 table many-to-many setup: Table A, table B, and a third Table that has the matching IDs from A and B to do the multi-to-multi.

How do I fetch this back from the database and present it as a JSON array? Everything seems to suggest using the database to make a delimited string and let clients turn it into an array. Silly.

#SQLAlchemy

2025-02-17

Just added SQLAlchemy from @zzzeek to our list! From raw SQL nightmares to elegant Python ORM - you've transformed how an entire generation of developers works with databases.

Thank you for this masterpiece of engineering!

#Python #SQLAlchemy #OpenSource

Marcos Dionemdione@en.osm.town
2025-02-08

I love this magick:

```
In [1]: import model

In [2]: model.Tooter
Out[2]: model.Tooter

In [3]: model.Tooter.account
Out[3]: <sqlalchemy.orm.attributes.InstrumentedAttribute at 0x7fbf7bd31bc0>

In [4]: model.Tooter.account == 'foo'
Out[4]: <sqlalchemy.sql.elements.BinaryExpression object at 0x7fbf8183a960>
```

:) #python #SQLAlchemy #metaprogramming

Albinalbiin
2025-02-02

Holy s*it, I just tried -orm for and my mind is blown away. After using for a long time this is like night and day!

2025-02-01

Бесконечное хранилище данных в Telegram

Изучая Aiogram, мне стало понятно, что лимиты для тг-ботов достаточно большие, поэтому с их помощью можно хранить объемные данные Немного покопавшись, я создал библиотеку, для того, чтобы было проще работать с данными

habr.com/ru/articles/878602/

#python #aiogram #sqlalchemy #telegram #sqlite #хранение_данных

2025-01-21

So in about an hour, I refactored out SQLAlchemy and Pydantic to replace it with SQLModel – and some tests are actually passing already! I continue to appreciate pytest and how easy that makes this kind of effort.

Starting with the device type class, I'm going to be working on rewriting my "queries" to fit the SQLModel expectations vs what I was using with SQLAlchemy. I'm using the term queries in quotes there since it looks more like I'm calling methods, and I do see some warnings from SQLModel suggesting what I can replace them with.

From there, I should hopefully be able to simplify my code, classes, data types, tables, and other pieces. That'll most likely be a job for Wednesday.

#rackroot #webdev #backend #database #fastapi #sqlmodel #programming #sqlalchemy #pytest

2025-01-16

Kdybych #juniorguru dělal znova, možná bych místo #Peewee použil #SQLAlchemy. Možná spolu s #PyDantic. A možná bych na to použil sqlmodel.tiangolo.com/ Možná. Kdo ví.

2025-01-13

FastAPI и Vue.js 3: телеграм-бот с MiniApp для записи и автоматических уведомлений. Пишем бэкенд

Сегодня я рад представить новый масштабный проект, в рамках которого мы подробно рассмотрим технологии и подходы, ранее не освещенные в моих статьях. На этот раз мы создадим телеграм-бота с MiniApp (ранее известным как WebApp) — это будет бот с интегрированным мини-сайтом прямо в Telegram. Для реализации проекта мы используем два основных фреймворка: 1. FastAPI — мощный Python-фреймворк, который мы задействуем для разработки API нашего телеграм-бота. Мы рассмотрим уникальный подход, позволяющий создать полноценный бэкенд, который будет закрывать как API-методы, так и функционал телеграм-бота. 2. Vue.js 3 — JavaScript-фреймворк, выбранный за его удобство разработки и возможности создания сложных визуальных элементов. В этой статье мы сосредоточимся на описании бэкенда, а создание приложения на Vue.js 3 будет вынесено на следующую статью.

habr.com/ru/companies/amvera/a

#fastapi #sqlalchemy #sqlalchemy_20 #telegram_bot #telegram_bot_api #telegram_mini_app #telegram_web_app #telegram_web_app_bot #apscheduler #python

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst