hasansezertasan / opinionated-mixins

Opinionated set of mixins. Implemented in Data Classes, Pydantic, SQLAlchemy, SQLModel, MongoEngine, ODMantic, Beanie, and WTForms.
MIT License
2 stars 0 forks source link

How to name tables, collections, ORMs and ODMs? #1

Closed hasansezertasan closed 4 months ago

hasansezertasan commented 4 months ago

How to name tables, collections, ORMs and ODMs?

hasansezertasan commented 4 months ago

Analyze

Pydantic

Welcome to Pydantic - Pydantic

When we look at the official Pydantic documentation, Object Model naming is singular.

SQLAlchemy

ORM Quick Start — SQLAlchemy 2.0 Documentation

When we look at the official SQLAlchemy documentation, table and ORM naming are singular.

MongoEngine

1. Tutorial — MongoEngine 0.27.0 documentation

When we look at the official MongoEngine documentation, ODM naming is singular.

ODMantic

Modeling - ODMantic

When we look at the official ODMantic documentation, collection and ODM naming are singular.

Other

Is there a naming convention for MySQL? - Stack Overflow. In this question, the recommended way to name tables in MySQL is singular.

One other question: sql - Table Naming Dilemma: Singular vs. Plural Names - Stack Overflow which recommends naming tables in singular forms.

Other informing contents:

Conclusion

Table and collection names will be implemented according to the PEP-8 function and variable name standard, which is compatible with the above recommendations.

ORM and ODM names will be implemented according to the PEP-8 class name standard, which is compatible with the above recommendations.