crate / sqlalchemy-cratedb

SQLAlchemy dialect for CrateDB.
https://cratedb.com/docs/sqlalchemy-cratedb/
Apache License 2.0
3 stars 2 forks source link

UX: Improve situation with weird `__table_args__` syntax #142

Open amotl opened 5 months ago

amotl commented 5 months ago

Problem

Coming from those recent improvements ...

... @seut mentioned that the need to convey special CrateDB table options like that ...

__table_args__ = {
    'crate_"translog.durability"': "'async'",
}

... is very unfortunate from an UX perspective. I agree with that assessment.

Proposal

It would be so nice to be able to write it down like that, right?

__table_args__ = {
    "crate_translog.durability": "async",
}

Thoughts

SQLAlchemy will be the first instance to receive those options, while evaluating the ORM model. We will need to check where it breaks down the line, and whether we can do something to improve on behalf of the dialect implementation, or if there would be a need to improve SQLAlchemy itself to support such edge cases.

Bonus

The documentation about __table_args__ is also a bit thin, and should be improved.