ORM or SQL? |
Hello,
What is the best practice for db work by most developers? Them orm must have more overhead dealing with models and entities. Is it better to just use sql? if so, do most of you use sql in controller or create a library? I guess you could even have one model class and pass the sql and table name in.
Personally, I don't do ORM's but I can see their appeal, I'm happy with just the query builders. Ultimately it is up to you and your needs.
Practical guide to IgnitedCMS - Book coming soon, www.ignitedcms.com
Controllers, models,... for what?
Write everything in one file and layout and query to the database. (03-17-2022, 06:57 AM)iRedds Wrote: Controllers, models,... for what? I do not understand your suggestion. Can you explain? (03-17-2022, 06:55 AM)ignitedcms Wrote: Personally, I don't do ORM's but I can see their appeal, I'm happy with just the query builders. Ultimately it is up to you and your needs. Where do you put your query builder logic? In controller?
No I typically put my query builder logic in models, but if I understood correctly was the question regarding the pros and cons of using a ORM?
Practical guide to IgnitedCMS - Book coming soon, www.ignitedcms.com
If you have a lot of business logic that needs multiple models then create a library and load the models in it.
What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |