home.social

#alembic — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #alembic, aggregated by home.social.

fetched live
  1. Banking firms denied cloud access are getting a boost: Alembic just built its own GPU supercomputer, powered by Nvidia tech, to keep AI workloads on‑prem. Backed by a fresh Series A, the venture aims to secure sensitive finance data while delivering high‑speed processing. Curious how this could reshape fintech infrastructure? Read on. #AI #GPU #Alembic #Finance

    🔗 aidailypost.com/news/alembic-b

  2. @dashdsrdash Oh yeah, I'm not a fan of directly emitting SQL (hi, injection vectors!). Totally willing to wrap the creation of the SQL in a language-specific well-typed abstract syntax tree.

    What's biting me in the ORM I'm using is that the ORM has a lot of implicit behavior around class construction but that abstraction is leaky. Among the leaks:

    • alembic auto-builds migration steps based on the shape of a sqlalchemy model. It can build migration scripts that don't run (for example, if you don't name your foreign keys it builds them with None names in the alembic script and aelmbic can't roll back an unnamed key).

    • we have a binding layer between sqlalchemy and strawberry (GraphQL API generation) that treats fields that are mapped columns and fields that are relationships differently. Knowing which fields are relationships and which are mapped columns is just something you go look up in the model.

    At this point, I'd like to throw out about half of this magic and just have alembic migration files and a GraphQL binding layer that just builds SQL queries to populate GraphQL fields.

    Part of me also wonders how much of my irritation is ORMs in general and how much is sqlalchemy in particular. The docs for sqlalchemy include examples for making one-to-one, one-to-many, and many-to-many mappings between model ORM constructs. Those three terms aren't keywords in the API, they're patterns you have to hold your mouth a specific way to make them happen in the model bindings. All this magic and they didn't provide a macro for the three most common patterns in relational database association? "But why though?"

    #sqlalchemy #alembic #strawberry

  3. @dashdsrdash Oh yeah, I'm not a fan of directly emitting SQL (hi, injection vectors!). Totally willing to wrap the creation of the SQL in a language-specific well-typed abstract syntax tree.

    What's biting me in the ORM I'm using is that the ORM has a lot of implicit behavior around class construction but that abstraction is leaky. Among the leaks:

    • alembic auto-builds migration steps based on the shape of a sqlalchemy model. It can build migration scripts that don't run (for example, if you don't name your foreign keys it builds them with None names in the alembic script and aelmbic can't roll back an unnamed key).

    • we have a binding layer between sqlalchemy and strawberry (GraphQL API generation) that treats fields that are mapped columns and fields that are relationships differently. Knowing which fields are relationships and which are mapped columns is just something you go look up in the model.

    At this point, I'd like to throw out about half of this magic and just have alembic migration files and a GraphQL binding layer that just builds SQL queries to populate GraphQL fields.

    Part of me also wonders how much of my irritation is ORMs in general and how much is sqlalchemy in particular. The docs for sqlalchemy include examples for making one-to-one, one-to-many, and many-to-many mappings between model ORM constructs. Those three terms aren't keywords in the API, they're patterns you have to hold your mouth a specific way to make them happen in the model bindings. All this magic and they didn't provide a macro for the three most common patterns in relational database association? "But why though?"

    #sqlalchemy #alembic #strawberry

  4. Hi folks. I started with a #cli tool that should manage db migrations for different #data projects on different db types. How do you manage your databases and migrations that are not bound to an application let's say? #sqlalchemy #python #typer #alembic? What features would you like to have?

  5. Hi folks. I started with a #cli tool that should manage db migrations for different #data projects on different db types. How do you manage your databases and migrations that are not bound to an application let's say? #sqlalchemy #python #typer #alembic? What features would you like to have?

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

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

    habr.com/ru/companies/ntechlab

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

  7. Структура FastAPI приложения

    В данной статья я решил описать свой опыт создания шаблона для проектов, использующих FastAPI, SQLAlchemy, Docker

    habr.com/ru/articles/871018/

    #FastAPI #Python #Docker #SQLAlchemy #Alembic #Репозиторий #Шаблон #Структура

  8. I've been working on a Typer CLI app with a database backend. Each time I need to set up Alembic (for migrations), I need to go back to the docs and learn all the things (again)...

    I wanted to see if I could incorporate alembic commands into my own CLI app. At the least, it would let me inject some custom logic and/or command names.

    Wasn't quite sure where to start, but eventually I got there...

    So I decided to write about it.

    pythonbynight.com/blog/alembic

  9. I've been working on a Typer CLI app with a database backend. Each time I need to set up Alembic (for migrations), I need to go back to the docs and learn all the things (again)...

    I wanted to see if I could incorporate alembic commands into my own CLI app. At the least, it would let me inject some custom logic and/or command names.

    Wasn't quite sure where to start, but eventually I got there...

    So I decided to write about it.

    pythonbynight.com/blog/alembic

    #Python #Alembic #ORM

  10. , the migration tool for , supports not only schema upgrades but also downgrades and branch merges, so I didn't have much trouble moving between different branches with slightly different schemas in my local development environment, which is something I don't think many database migration tools offer.

    alembic.sqlalchemy.org/en/late

  11. Игра 2048 в вашем Telegram-боте: как создать MiniApp с помощью FastAPI и Aiogram за несколько шагов

    Превращаем известную игру 2048 в увлекательный Telegram-бот! Расскажу, как за несколько шагов создать MiniApp с помощью FastAPI и Aiogram, интегрировать API и настроить базы данных. Пошаговое руководство для тех, кто хочет освоить разработку на новом уровне.

    habr.com/ru/companies/amvera/a

    #telegram #telegram_mini_app #telegram_web_app #telegrambot #python #fastapi #sqlite3 #sqlalchemy_20 #alembic

  12. Асинхронный SQLAlchemy 2: простой пошаговый гайд по настройке, моделям, связям и миграциям с использованием Alembic

    Наконец-то пришло время взяться за то, что я давно планировал — подробный гайд по асинхронной версии SQLAlchemy 2.0 в стиле ORM . В этой серии статей я подробно расскажу обо всех аспектах: от создания моделей и установления связей между ними до миграций с Alembic и взаимодействия с данными в базе. Мы будем шаг за шагом разбирать ключевые моменты работы с асинхронной базой данных, что позволит вам глубже понять SQLAlchemy и применить эти знания на практике. Для начала, давайте разберёмся, что такое SQLAlchemy и почему каждый разработчик, работающий с реляционными базами данных (такими как SQLite, PostgreSQL, MySQL и т. д.), должен знать о ней. После этого — настройка. Мы будем работать с PostgreSQL, но не переживайте: код, который мы напишем, универсален для всех реляционных баз данных. Мы начнем с базовой настройки SQLAlchemy для асинхронного взаимодействия, а затем перейдём к созданию таблиц в современном декларативном стиле.

    habr.com/ru/companies/amvera/a

    #sqlalchemy #postgresql #асинхронная_sqlalchemy #alembic #миграции_базы_данных

  13. Простой мини-чат на FastApi: Современный интерфейс, вебсокеты и SQLAlchemy с деплоем

    Привет, друзья! Сегодня я подготовил для вас увлекательную практическую статью о создании мини-чата на FastApi. Мы погрузимся в мир вебсокетов, узнаем, зачем они нужны и как применяются в реальных приложениях. Также я продемонстрирую работу с асинхронной SQLAlchemy на примере взаимодействия с базой данных SQLite. Для создания современного интерфейса мы обратимся к интересному и бесплатному сервису Websim.ai, который за пару минут сгенерирует нам интерфейс, включая страничку для входа/регистрации и страницу самого чата. Чтобы наш чат мог обслуживать множество пользователей одновременно, мы выполним деплой нашего FastApi приложения. Для этого воспользуемся сервисом

    habr.com/ru/companies/amvera/a

    #fastapi #sqlalchemy #sqlite #вебсокеты #fastapi_вебсокеты #websocket #websockets_fastapi #alembic #javascript #java_script_websockets

  14. Создание собственного API на Python (FastAPI): Структура проекта, SQLAlchemy PostgreSQL, миграции и первые модели таблиц

    Приветствую всех, друзья! Наша последняя статья по созданию собственного API на FastAPI вызвала огромный интерес, и за это я искренне благодарен. Ранее мы рассматривали базовые аспекты работы с FastAPI: различные типы запросов, их валидацию и обработку, а также ответы на эти запросы. Однако, это лишь верхушка айсберга. Уже на данном этапе код становится громоздким и сложным для понимания. К тому же, хранение данных в JSON-файлах — это далеко не самый профессиональный подход. "Нормальные ребята" используют SQLAlchemy, причем асинхронно. Сегодня мы займемся интеграцией асинхронной SQLAlchemy в наше FastAPI-приложение. Для упрощения навигации и понимания кода я предложу структуру проекта, которую сам использую в каждом FastAPI-приложении. Отдельное внимание уделим миграциям с Alembic: что это такое и зачем они нужны. Конкретные функции для взаимодействия с базой данных мы будем рассматривать в следующей статье. Сегодня же займемся подключением, миграциями, описанием моделей таблиц и их созданием.

    habr.com/ru/articles/827222/

    #alembic #sqlalchemy #sqlalchemy_20 #fastapi

  15. Пишем универсальный прототип бэкенд-приложения: Litestar, FastStream, dishka

    Привет, Хабр! Меня зовут Сергей, я техлид в команде PT BlackBox. Мы с коллегами разрабатываем продукт, который позволяет обнаруживать уязвимости в приложениях методом черного ящика. Фактически мы сами и пишем веб-приложения, и именно о них пойдет речь в статье. Я бы хотел с вами поделиться своими наработками по теме бэкенд-приложений и предоставить вам шаблон-прототип, который, как мне кажется, может закрыть подавляющее большинство потребностей при их разработке. Для написания прототипа я буду использовать Litestar , FastStream и dishka . Эта статья будет особенно полезна тем, кто пишет на Tornado, Django, Flask или AIOHTTP и хочет перейти на более актуальные технологии для дальнейшего развития своих проектов на современных рельсах. Ну что ж, приступим

    habr.com/ru/companies/pt/artic

    #python #Litestar #прототип #web #faststream #asgi #sqlalchemy #alembic #pydantic #dishka

  16. "So why do we use #sqlalchemy and #alembic ?"

    "Because treating data as semantic types is way better than treating it as raw strings. And these tools do the marshalling for us so we don't have to digest SQL responses or build raw SQL queries."

    "Cool. So why are you throwing that chair through a window?"

    "Because my alembic migration failed because server_default=False is a runtime error; Alembic expects server_default='false' because it's just gluing the value into a SQL statement under the hood."

  17. "So why do we use #sqlalchemy and #alembic ?"

    "Because treating data as semantic types is way better than treating it as raw strings. And these tools do the marshalling for us so we don't have to digest SQL responses or build raw SQL queries."

    "Cool. So why are you throwing that chair through a window?"

    "Because my alembic migration failed because server_default=False is a runtime error; Alembic expects server_default='false' because it's just gluing the value into a SQL statement under the hood."

  18. #Endurain backend revamp feature parity is completed and new features are implemented like user password reset and Strava gear retrieval.

    I thought about realising it now under the v0.1.4 tag, but I will try to implement #Alembic to manage DB changes and DB creation first.

    Also discovered #SQLModel to manage DB connections, appears to be simpler, so need to check it in the future.

  19. "Spline Smoke"

    Found an old alembic file when I looked for something to test VVVV import of animations and thought this looked rather nice with additive shading of the lines... 🙂

    #vvvv #MadeWithVVVV #alembic #curves #additive

  20. TIL: `alembic --autogenerate` can be taught to use sequential revision ids in the filename: stackoverflow.com/a/67398484/1

  21. v0.5.0 just shipped! 🚢

    The main update this release is the switch from direct alembic usage to reflex db, updating the nginx configuration, and a few other dependency updates.

    As always, the latest release and detailed changelog is available at geniepy.com!

    #alembic #boilerplate #buildinpublic #indiedev #nginx #python #reflex #saas #solopreneur

  22. I'm preparing the next version for release right now and it'll replace direct alembic usage with the reflex db CLI introduced recently: reflex.dev/docs/database/overv

    (Of course, there's a few other changes that'll go in as well. This is just one of the big ones.)

    #alembic #buildinpublic #database #python #reflex

  23. some notes of mine, on upgrading/transitioning alembic to an async set-up and what I'm especially proud of, on how to differentiate the environment for alembic in a, in my opinion, most easy and concise way:
    hrdina.me/posts/async-alembic-

    Would love to read some opinions/comments!

  24. Sunday night and Monday were spent on sqlalchemy and alembic and async stuff. My dream in the night from Monday to Tuesday were very sqlalchemy intense. That work will probably result in one or two blog posts about my findings :) Let's see what tonight's dream bring.

  25. Is there a blazingly fast cli mesh processor out there? Think ffmpeg for data?

    My use case, generate decimated (low res mesh, tri's are fine) geo from an input

    Has anyone worked with at all? Is it worth exploring?

    via is painfully slow. I could also consider via it pypi package, or but will need to test those.

  26. Is there a blazingly fast cli mesh processor out there? Think ffmpeg for #3D data?

    My use case, generate decimated (low res mesh, tri's are fine) geo from an input #alembic

    Has anyone worked with #OpenMesh at all? Is it worth exploring?

    #Maya via #Mayapy is painfully slow. I could also consider #blender via it pypi package, or #houdini but will need to test those.

    #pipelinetd #pipeline #animation

  27. Getting Flask_SQLAlchemy up, running, and under test was *so* painful today but now that it is, I'm using it like a hot knife cutting through butter.

    Next challenge: Alembic migrations.

    #Python #Flask #SQLAlchemy #Alembic

  28. Getting Flask_SQLAlchemy up, running, and under test was *so* painful today but now that it is, I'm using it like a hot knife cutting through butter.

    Next challenge: Alembic migrations.

    #Python #Flask #SQLAlchemy #Alembic

  29. @beyondmachines1 @truls46 so why not sql in a migration? E.g. (#python) allows it, I would expect every other orm has such a thing, too.

  30. @beyondmachines1 @truls46 so why not sql in a migration? E.g. #alembic (#python) allows it, I would expect every other orm has such a thing, too.

  31. New Pybites video is up:
    Database migrations matter! Get up and running with Alembic + sqlmodel
    youtu.be/gekC1ESLxPs

    #python #databases #alembic #sqlmodel

  32. Welcome Bot v0.2.1 is now available. Send custom messages to new users when they join the Mastodon Instance. Now alerts the Bot mods with DM's when a new user is Welcomed. Control the bot through API endpoints or the built-in Docs. #MastoAdmin #Bot #Docker #Python #FastAPI #Postgres #Alembic

    github.com/stranger-social/wel