prom
prom copied to clipboard
replace fields and pk as fields on the orm
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:
- Add support for using
pk,primary,fieldsandcolumns - Update internal code to use
primaryandcolumns - Add deprecate warnings for external interface like
Orm.fields
Keyword information:
- postgres SQL keywords and you can get them using sql also:
select * from pg_get_keywords() - SQLite reserved words
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.