Jaymon / prom

A PostgreSQL or SQLite orm for Python
MIT License
22 stars 4 forks source link

replace fields and pk as fields on the orm #86

Open Jaymon opened 5 years ago

Jaymon commented 5 years ago

so pk and fields are not reserved keywords and that means they technically could be used as table column names even though this would completely break prom, this has never been a problem because usually Prom is the one creating the schema, but prom can be used to generated orms from an existing database, so it's also not ideal.

We could rename pk to primary and fields to columns as those are reserved SQL keywords. This would be a long long deprecation cycle where the steps would be:

  1. Add support for using pk, primary, fields and columns
  2. Update internal code to use primary and columns
  3. Add deprecate warnings for external interface like Orm.fields

Keyword information:

Jaymon commented 5 years ago

Django uses fields, which is probably why I chose fields since Django was the last orm I had used before writing prom.

Doctrine uses columns, this is what we used at Plancast so I was curious if that was where field came from.