#alembic — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #alembic, aggregated by home.social.
-
【初心者】一番丁寧にデータベースのマイグレーションとORMapperを理解したい(マイグレーション編)
https://qiita.com/masa-asa/items/6b0af0dfa00301c940c8?utm_campaign=popular_items&utm_medium=feed&utm_source=popular_items -
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
🔗 https://aidailypost.com/news/alembic-builds-own-gpu-supercomputer-serve-banks-barred-from-cloud
-
@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?"
-
@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?"
-
New Mediterranean restaurant to open in Bristol Airport
Travellers passing through a major UK airport will soon be able to enjoy Mediterranean-inspired dining. Alembic,…
#dining #cooking #diet #food #mediterranean #MediterraneanDiet #MediterraneanFood #Breakfast #MediterraneanBreakfast #Alembic #breakfast #BristolAirport #GambasalAjillo #KateGwyther #Mediterranean #Mediterraneaninspired #restaurant
https://www.diningandcooking.com/2132642/new-mediterranean-restaurant-to-open-in-bristol-airport/ -
LitestarCatsCV. Тренируемся на кошках. Реализация API и работа с данными
Что вас ждёт: Если в первой части мы заложили фундамент проекта (выбор инструментов, настройка окружения и структура), то здесь мы превратим этот каркас в полноценное API для управления резюме кошек (или людей — как вам ближе). Мы подключим базу данных, добавим тесты, настроим миграции и даже проверим всё в действии. К концу статьи у вас будет рабочее API, которое можно потрогать руками (или лапками 🐾). Полный код доступен на GitHub — ссылка в конце!
https://habr.com/ru/companies/ntechlab/articles/889022/
#python #python3 #litestar #alembic #sqlalchemy #orm #pytest #asyncpg
-
Структура FastAPI приложения
В данной статья я решил описать свой опыт создания шаблона для проектов, использующих FastAPI, SQLAlchemy, Docker
https://habr.com/ru/articles/871018/
#FastAPI #Python #Docker #SQLAlchemy #Alembic #Репозиторий #Шаблон #Структура
-
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.
https://pythonbynight.com/blog/alembic-migrations-existing-typer-cli
-
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.
https://pythonbynight.com/blog/alembic-migrations-existing-typer-cli
-
#Alembic, the migration tool for #SQLAlchemy, 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.
-
Игра 2048 в вашем Telegram-боте: как создать MiniApp с помощью FastAPI и Aiogram за несколько шагов
Превращаем известную игру 2048 в увлекательный Telegram-бот! Расскажу, как за несколько шагов создать MiniApp с помощью FastAPI и Aiogram, интегрировать API и настроить базы данных. Пошаговое руководство для тех, кто хочет освоить разработку на новом уровне.
https://habr.com/ru/companies/amvera/articles/853870/
#telegram #telegram_mini_app #telegram_web_app #telegrambot #python #fastapi #sqlite3 #sqlalchemy_20 #alembic
-
Асинхронный SQLAlchemy 2: простой пошаговый гайд по настройке, моделям, связям и миграциям с использованием Alembic
Наконец-то пришло время взяться за то, что я давно планировал — подробный гайд по асинхронной версии SQLAlchemy 2.0 в стиле ORM . В этой серии статей я подробно расскажу обо всех аспектах: от создания моделей и установления связей между ними до миграций с Alembic и взаимодействия с данными в базе. Мы будем шаг за шагом разбирать ключевые моменты работы с асинхронной базой данных, что позволит вам глубже понять SQLAlchemy и применить эти знания на практике. Для начала, давайте разберёмся, что такое SQLAlchemy и почему каждый разработчик, работающий с реляционными базами данных (такими как SQLite, PostgreSQL, MySQL и т. д.), должен знать о ней. После этого — настройка. Мы будем работать с PostgreSQL, но не переживайте: код, который мы напишем, универсален для всех реляционных баз данных. Мы начнем с базовой настройки SQLAlchemy для асинхронного взаимодействия, а затем перейдём к созданию таблиц в современном декларативном стиле.
https://habr.com/ru/companies/amvera/articles/849836/
#sqlalchemy #postgresql #асинхронная_sqlalchemy #alembic #миграции_базы_данных
-
Простой мини-чат на FastApi: Современный интерфейс, вебсокеты и SQLAlchemy с деплоем
Привет, друзья! Сегодня я подготовил для вас увлекательную практическую статью о создании мини-чата на FastApi. Мы погрузимся в мир вебсокетов, узнаем, зачем они нужны и как применяются в реальных приложениях. Также я продемонстрирую работу с асинхронной SQLAlchemy на примере взаимодействия с базой данных SQLite. Для создания современного интерфейса мы обратимся к интересному и бесплатному сервису Websim.ai, который за пару минут сгенерирует нам интерфейс, включая страничку для входа/регистрации и страницу самого чата. Чтобы наш чат мог обслуживать множество пользователей одновременно, мы выполним деплой нашего FastApi приложения. Для этого воспользуемся сервисом
https://habr.com/ru/companies/amvera/articles/846926/
#fastapi #sqlalchemy #sqlite #вебсокеты #fastapi_вебсокеты #websocket #websockets_fastapi #alembic #javascript #java_script_websockets
-
#Python Friday #235: DB Migrations With #Alembic and #FastAPI
https://improveandrepeat.com/2024/07/python-friday-235-db-migrations-with-alembic-and-fastapi/
-
#Python Friday #235: DB Migrations With #Alembic and #FastAPI
https://improveandrepeat.com/2024/07/python-friday-235-db-migrations-with-alembic-and-fastapi/
-
Создание собственного API на Python (FastAPI): Структура проекта, SQLAlchemy PostgreSQL, миграции и первые модели таблиц
Приветствую всех, друзья! Наша последняя статья по созданию собственного API на FastAPI вызвала огромный интерес, и за это я искренне благодарен. Ранее мы рассматривали базовые аспекты работы с FastAPI: различные типы запросов, их валидацию и обработку, а также ответы на эти запросы. Однако, это лишь верхушка айсберга. Уже на данном этапе код становится громоздким и сложным для понимания. К тому же, хранение данных в JSON-файлах — это далеко не самый профессиональный подход. "Нормальные ребята" используют SQLAlchemy, причем асинхронно. Сегодня мы займемся интеграцией асинхронной SQLAlchemy в наше FastAPI-приложение. Для упрощения навигации и понимания кода я предложу структуру проекта, которую сам использую в каждом FastAPI-приложении. Отдельное внимание уделим миграциям с Alembic: что это такое и зачем они нужны. Конкретные функции для взаимодействия с базой данных мы будем рассматривать в следующей статье. Сегодня же займемся подключением, миграциями, описанием моделей таблиц и их созданием.
-
#AR #Medieval #Apothecary in your space with #AppleVisionPro #App Spruce Up, try out in #Selfies & #Videos on #iPhone & #iPad
Includes items like #Glass #Alembic #Herbs #Spices #Mortar & #Petzel #Alcohol #Burner & #Medicine #Vial
Learn more at http://spruceup.vision/mastodon
#MixedReality #AugmentedReality #XR #VR #iOS #iPadOS #VisionPro #Apple #AppleProducts #WWDC24 #VRTech #VRTechnology #TechTrends #TechProducts #Tech #AppDesign #Technology #Innovation #AppDeveloper #Developer #TechnologyNews
-
Пишем универсальный прототип бэкенд-приложения: Litestar, FastStream, dishka
Привет, Хабр! Меня зовут Сергей, я техлид в команде PT BlackBox. Мы с коллегами разрабатываем продукт, который позволяет обнаруживать уязвимости в приложениях методом черного ящика. Фактически мы сами и пишем веб-приложения, и именно о них пойдет речь в статье. Я бы хотел с вами поделиться своими наработками по теме бэкенд-приложений и предоставить вам шаблон-прототип, который, как мне кажется, может закрыть подавляющее большинство потребностей при их разработке. Для написания прототипа я буду использовать Litestar , FastStream и dishka . Эта статья будет особенно полезна тем, кто пишет на Tornado, Django, Flask или AIOHTTP и хочет перейти на более актуальные технологии для дальнейшего развития своих проектов на современных рельсах. Ну что ж, приступим
https://habr.com/ru/companies/pt/articles/820171/
#python #Litestar #прототип #web #faststream #asgi #sqlalchemy #alembic #pydantic #dishka
-
"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=Falseis a runtime error; Alembic expectsserver_default='false'because it's just gluing the value into a SQL statement under the hood." -
"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=Falseis a runtime error; Alembic expectsserver_default='false'because it's just gluing the value into a SQL statement under the hood." -
#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.
-
"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... 🙂
-
Generate "create schema" migration statements with #alembic for only the not yet created schemas:
https://www.katzien.de/en/posts/2023-11-16-create-missing-schemas-in-alembic/
-
TIL: `alembic --autogenerate` can be taught to use sequential revision ids in the filename: https://stackoverflow.com/a/67398484/1380673
-
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 https://geniepy.com!
#alembic #boilerplate #buildinpublic #indiedev #nginx #python #reflex #saas #solopreneur
-
I'm preparing the next version for release right now and it'll replace direct alembic usage with the reflex db CLI introduced recently: https://reflex.dev/docs/database/overview/#migrations
(Of course, there's a few other changes that'll go in as well. This is just one of the big ones.)
-
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:
https://hrdina.me/posts/async-alembic-notes/Would love to read some opinions/comments!
#blogging #blogpost #alembic #sqlalchemy #python #notes #async #sqlite #mysql
-
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.
#dreaming #sqlalchemy #alembic #blogging -
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.
-
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.
-
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.
-
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.
-
@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.
-
@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.
-
New Pybites video is up:
Database migrations matter! Get up and running with Alembic + sqlmodel
https://youtu.be/gekC1ESLxPs -
New blog post: Sort primary columns from #python #sqlalchemy models to the front in #alembic
https://www.katzien.de/en/posts/2023-02-20-sorting-columns-in-alembic-sqlalchemy/