#1 2013-03-19 13:20:37

colbert
Member
Registered: 2013-03-02
Posts: 38
Website

Project with MySQL

Hello,

I'm starting a new project that I have to use MySQL as the database, in this project I'll be handling lots of joins and views.

In the framework, Can I use the ORM to do all this things (Connection, etc...)? With your experience what would be the best way to get those results?

Offline

#2 2013-03-19 16:07:11

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,660
Website

Re: Project with MySQL

MySQL is supported, but not fully tested here, since we do not have such a database at hand.
But in case of any problem, we will be very reactive.

The easiest is to use either ODBC, or ZeosLib to connect to MySQL.
Perhaps ZeosLib is a good option, since you do not need to set the ODBC properties at hand, and you have direct connection to the MySQL client library so you won't need an ODBC driver. And it supports MariaDB, which is a good alternative.

See Many-to-many about handled JOINs in the ORM, in the SAD pdf.
http://synopse.info/files/pdf/Synopse%2 … 201.18.pdf
But from my experiment, current implementation won't cover all cases you may need, especially if you need complex JOINs, and are using VIEWs.

In this case, my advice is to use ORM for basic data retrieval, but use tuned SQL statements and interface-based services to access the data from the client side.

It is perhaps worth reading the "ORM" and "data sharding" paragraphs in the SAD pdf, to discover that the full RDBMS paradigm may be too limited when using an ORM.
If you start your project by thinking about the SQL to write, you probably won't fit into the "ORM philosophy", which is to work with objects, then use the DB to persist them.

Offline

Board footer

Powered by FluxBB