Welcome Guest, Not a member yet? Register   Sign In
ORM or SQL?
#1

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.
Reply
#2

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
Reply
#3

Controllers, models,... for what?
Write everything in one file and layout and query to the database.
Reply
#4

(This post was last modified: 03-17-2022, 07:11 AM by frocco.)

(03-17-2022, 06:57 AM)iRedds Wrote: Controllers, models,... for what?
Write everything in one file and layout and query to the database.

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?
Reply
#5

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
Reply
#6

(03-17-2022, 07:14 AM)ignitedcms Wrote: 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?

ok, thank you
Reply
#7

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 )
Reply
#8

(03-18-2022, 12:03 AM)InsiteFX Wrote: If you have a lot of business logic that needs multiple models then create a library and load the models in it.

Thank you
Reply




Theme © iAndrew 2016 - Forum software by © MyBB