Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

User ORM instead of direct sql query #82

Open
coulisse opened this issue Jan 2, 2025 · 0 comments
Open

User ORM instead of direct sql query #82

coulisse opened this issue Jan 2, 2025 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@coulisse
Copy link
Owner

coulisse commented Jan 2, 2025

Using an ORM (Object-Relational Mapping) offers numerous advantages, especially when working with object-oriented languages like Python. Here are some of the main reasons why it might be better to use an ORM:

  • Database Abstraction: An ORM allows you to work with the database at a higher level of abstraction, using objects instead of SQL queries. This makes the code more readable and maintainable.
  • Increased Productivity: With an ORM, you can write less boilerplate code to perform common database operations. This allows you to focus more on the application logic.
  • Database Independence: By using an ORM, your application code is less tied to a specific type of database. This makes it easier to switch databases in the future without having to rewrite all the SQL code.
  • Relationship Management: An ORM automatically handles the relationships between database tables, making it easier to work with complex and interconnected data.
  • Security: ORMs can help prevent SQL injection attacks by using safe methods to construct SQL queries.

Some ORMs:

  • SQLAlchemy: One of the most powerful and flexible ORM available for Python. It offers a rich and comprehensive interface for working with relational databases and can be used together with Pandas to manipulate data.
  • Peewee: A lightweight and easy-to-use ORM, ideal for small to medium-sized projects. It has an expressive query syntax and supports MySQL, PostgreSQL, and SQLite.
@coulisse coulisse added the enhancement New feature or request label Jan 2, 2025
@coulisse coulisse added this to the Use SQL Alchemy or other ORM milestone Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant