mastodon.top est l'un des nombreux serveurs Mastodon indépendants que vous pouvez utiliser pour participer au fédiverse.
Mastodon.top est une instance francophone stable, régulièrement mise à jour et accessible à tous hébergée par VirtuBox

Statistiques du serveur :

1,5K
comptes actifs

#sqlalchemy

0 message0 participant0 message aujourd’hui

Well this is messing with me:

SQLAlchemy column definition:
start_time = Column(DateTime, nullable=False, comment="Activity start date (DateTime)")

SQLAlchemy query:
activity_db = (db.query(activities_models.Activity).filter(activities_models.Activity.id == activity_id).first())

print(type(activity_db.start_time))
print(activity_db.start_time)

First print returns: <class 'str'>
Second print returns: 2024-11-25T16:49:52+0100

Boost welcomed 🙃

Why?! #Python #help #MySQL #SQLAlchemy #boost

As a DBA, I always want developers to use database transactions and appropriate levels of locking. Because I'm tired of seeing explicit locking of tables or autocommit enabled.

BUT, after two days of trying to patch a simple CRUD app to apply my own rules, failing miserably, I just want to remove all this ORM crap and use raw SQL.

That's it.

Tomorrow, I will rewrite this monstrosity.

A répondu dans un fil de discussion

@veronica #sqlalchemy has been nothing but trouble in our team. Lazy loading makes you have more transactions that last longer and also leads to the n+1 query problem. And I hate the query constructor to me it’s harder to understand than plain old SQL. We’re stripping it off to get back down to the #psycopg2 layer.

trying #alembic (with #sqlalchemy) to migrate some sql schema, everything running with smooth except when I change constraint (unique=True).

alembic can't process this migrate because SQLite have limitation on modifying constraint schema using ALTER TABLE.

I have trying to use BATCH MODE but did not meet my expectations. 🥲

I am feeling extremely pleased with myself to have had some code accepted into #SQLAlchemy!

It's just a few lines to let unique constraint detection on #SQLite handle tabs, but I've been using SQLAlchemy for years, and it's in lots other #python libraries like #pandas. It's exciting that now some of the code is mine!

For non-programmers, I think this is how it must have felt to have played 2nd triangle in the orchestra doing the backing on the Beatles' Eleanor Rigby.

github.com/sqlalchemy/sqlalche

GitHubUpdate SQLite UNIQUE constraint parsing to handle tabs by volcan01010 · Pull Request #11759 · sqlalchemy/sqlalchemyPar volcan01010

Just released Flask-Alembic 3.1.0, which integrates Flask with Alembic database migrations. It now supports Flask-SQLAlchemy-Lite or plain SQLAlchemy in addition to Flask-SQLAlchemy; multiple databases; and postprocessing generated files with tools like black, ruff, pre-commit, or even `git add`. It also has other cool features, check it out: flask-alembic.readthedocs.io #Python #Flask #SQLAlchemy

flask-alembic.readthedocs.ioFlask-Alembic 3.1.0 documentation

Announcing Flask-SQLAlchemy-Lite, a new lightweight replacement for Flask-SQLAlchemy that provides engine configuration and session lifetime, but none of the other custom stuff in the prior extension. It works with Flask and Quart, sync and async. I figured out the core idea on the flight to PyCon US, teased it during FlaskCon, and now it's available! Check out the docs to get started! flask-sqlalchemy-lite.readthed #Python #Flask #SQLAlchemy

Looking forward to SQLAlchemy 2.1 so I can do `ForeignKey(lambda: Other.id)` instead of `ForeignKey("other.id")`, and `relationship(back_populates=lambda: Other.things)`. Last little bit needed to for (non-string) forward references that don't cause circular imports. #Python #SQLAlchemy

Sooo… I wanted to give #superset a try to dig into some #OpenSearch data. But the #SQLAlchemy dependency it use to connect to data sources only has partial support for OpenSearch ATM, and while testing I had a lot of weird issues. Currently the connector stick to an old version of elasticsearch-py, so I started to add support for OpenSearch to it using opensearch-py hoping it would help.

In the end, I unfortunately seem to be at the same place with most queries not working as expected 😭. (1/4)

Just released Flask-Alembic 3.0! This extension combines Flask and Flask-SQLAlchemy with the Alembic migration library, providing CLI and programatic access to Alembic's functionality. It went 7.5 years without needing a release. This fixes compatibility with Flask-SQLAlchemy 3.1, and generally modernizes the project, tooling, and minimum requirements. github.com/davidism/flask-alem #Python #Flask #SQLAlchemy

GitHubRelease 3.0.0 · davidism/flask-alembicThis updates compatibility with Flask-SQLAlchemy 3.1, and generally modernizes the project layout, tooling, code, and minimum versions. I've made this a milestone release (3.0) rather than a featur...

I've got a sneak peak of my latest open source project: Paracelsus.

Long story short, I got sick of manually making database diagrams for SQLAlchemy. The data is all there, so why not generate the diagrams directly?

Paracelsus (named after the alchemist who wrote about mermaids) will read your database models and create diagrams in either Mermaid or Dot format. It can also be used to inject diagrams in markdown files as code blocks.

#python #sqlalchemy #opensource

github.com/tedivm/paracelsus

GitHubGitHub - tedivm/paracelsus: Visualize SQLAlchemy Databases using Mermaid or Dot Diagrams.Visualize SQLAlchemy Databases using Mermaid or Dot Diagrams. - GitHub - tedivm/paracelsus: Visualize SQLAlchemy Databases using Mermaid or Dot Diagrams.