I think I get why Cloudflare’s CTO is asking this question.  personally started using Django for backend development, boy, that thing is robust and cool, esp…

  • onlinepersona@programming.dev
    link
    fedilink
    arrow-up
    2
    ·
    1 month ago

    SQLalchemy is horrible, IMO. You have to read so much of its documentation to get a grip on things. And the backwards compatible changes they made while moving to (I think) SQLAlchemy2 make it terribly difficult to tell apart the API. And type hints were an abomination to deal with when they tried adding them (it’s better now).

    And don’t get me started on migrations with alembic.

    I wish the Django ORM could be extracted from Django and used in other projects, but then I also just want to go back to Django.

    • logging_strict@programming.dev
      link
      fedilink
      arrow-up
      1
      ·
      edit-2
      9 days ago

      Reply to /u/onlinepersona SQLAlchemy crocodile tears.

      Really need a layer between SQLAlchemy and FastAPI (or litestar, …). Otherwise would be messing around with SQLAlchemy/alembic internals for years. SQLAlchemy is an incredible time sink without that additional layer.

      Created just such a package just never got around to publishing it:

      • static type checking throughout
      • sync and async support throughout
      • alembic support (both async and sync)
      • multiple databases. One per config file!
      • model built from dotted path of (sqlmodel and sqla mixins) components module
      • UDF (user defined functions)
      • database settings (PRAGMA, SHOW, SET, …)
      • sqlite-[pysqlite|sqlcipher|aiosqlite] and postgresql-[psycopg2|asyncpg] supported
      • config does not store the password

      Issues:

      • retire sqlite-sqlcipher PRAGMA rekey and key. Password in config unsafe
      • authentication by pulling from a password manager not implemented
      • strict validation of postgresql SHOW/SET keys incomplete