FORUM IS CLOSED. PLEASE USE QUESTIONS / ANSWERS PAGE INSTEAD
Login  |  Forum  |  Search   

Board index » Development » Feature requests




Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next
 
Author Message
 Post subject: Use ORM as database abstraction layer
 Post Posted: Sat Feb 27, 2010 11:17 am 
Offline

Joined: Sat Feb 27, 2010 9:42 am
Posts: 30
As noted in this thread:
viewtopic.php?f=5&t=99&p=464#p464
A bug in PHP causes IP to malfunction on some php plattforms.

Here is a request to move the entire Database handling to an ORM.
I propose Propel here (http://propel.phpdb.org/trac/)
You get an abstraction layer which allows you to work on mysql, oracle sql, mssql, sqlite and so on without doing the whole query stuff by hand.
You also can use the generator abilities of an ORM to avoid manual sql handling and you get all your tables wrapped in very usefull Objects which enforce OOP.

There are other ORMs like Doctrine which I do not recommend since Propel is more mature and better in terms of speed and language-query-clearness.

Again no offence, but I spent half a day debugging stuff which could be easily avoided


Top 
 Profile  
 
 Post subject: Re: Use ORM as database abstraction layer
 Post Posted: Sat Feb 27, 2010 1:08 pm 
Offline
Project Developer

Joined: Tue Apr 28, 2009 9:43 am
Posts: 1720
We are listening. What the others think about this idea?


Top 
 Profile  
 
 Post subject: Re: Use ORM as database abstraction layer
 Post Posted: Sun Feb 28, 2010 7:01 pm 
Offline

Joined: Tue Nov 24, 2009 12:10 pm
Posts: 111
IP is not compatibile with 5.2, crashes only on some 5.3.0, can by installed > 5.3.1.

IMHO for now modules are more important. 5.3.0 will by replace very soon as all ISP with 5.3 will upgrade it.

Now bigger problem is to have hosting with 5.3 ;)


Top 
 Profile  
 
 Post subject: Re: Use ORM as database abstraction layer
 Post Posted: Sun Apr 18, 2010 8:15 am 
Offline
Project Developer

Joined: Tue Apr 28, 2009 9:43 am
Posts: 1720
What does the community think about ezSQL?

http://www.woyano.com/jv/ezsql


Top 
 Profile  
 
 Post subject: Re: Use ORM as database abstraction layer
 Post Posted: Sun Apr 18, 2010 8:44 am 
Offline

Joined: Sat Feb 27, 2010 9:42 am
Posts: 30
It does not provide relation rows as objects, am i right?


Top 
 Profile  
 
 Post subject: Re: Use ORM as database abstraction layer
 Post Posted: Sun Apr 18, 2010 2:04 pm 
Offline
Project Developer

Joined: Tue Apr 28, 2009 9:43 am
Posts: 1720
As I understand, it does http://justinvincent.com/docs/ezsql/ez_sql_help.htm

First example shows how to get a row as an object. It is what you are talking about?


Top 
 Profile  
 
 Post subject: Re: Use ORM as database abstraction layer
 Post Posted: Sun Apr 18, 2010 2:07 pm 
Offline

Joined: Sat Feb 27, 2010 9:42 am
Posts: 30
No, it doenst, this just uses the mysql fetch call and retrieve sets as simple objects.
An ORM like Propel would not mess with sql on user side.
You would write sth like
Code:
$u = new User();
$u->setName("foo");
$u->setAge(12);
$u->setFriend($otherUser);
$u->save(); // this saves the object into database


So you see it creates objects from schema definition, it recognizes foreign key relations, support 1-n, 1-1, n-m relations


Top 
 Profile  
 
 Post subject: Re: Use ORM as database abstraction layer
 Post Posted: Sun Apr 18, 2010 3:01 pm 
Offline
Project Developer

Joined: Tue Apr 28, 2009 9:43 am
Posts: 1720
But I think it is much slower. No?

And why do you suggest Propel? What do you think about Doctrine?


Top 
 Profile  
 
 Post subject: Re: Use ORM as database abstraction layer
 Post Posted: Sun Apr 18, 2010 3:07 pm 
Offline

Joined: Sat Feb 27, 2010 9:42 am
Posts: 30
Sure all the logic requires cpu cycles but propel is used in some frameworks and some big enterprise sites since you can tune the performance and you win much more from an OOP DB approach.

Doctrine ist regarded slower and not that mature than propel, the DQL (Doctrine query language) is also more restricted in some cases. However I tried both and Propel won and still wins for me


Top 
 Profile  
 
 Post subject: Re: Use ORM as database abstraction layer
 Post Posted: Sat Apr 24, 2010 6:36 pm 
Offline
Project Developer

Joined: Tue Apr 28, 2009 9:43 am
Posts: 1720
How about installation? Does it possible to install Propel on all shared hosting servers? The requirements look very huge and requires access to command line. Right?


Top 
 Profile  
 
Display posts from previous:  Sort by  
 
Post new topic Reply to topic  [ 19 posts ]  Go to page 1, 2  Next

Board index » Development » Feature requests


 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron