osTicket / osTicket

The osTicket open source ticketing system official project repository, for versions 1.8 and later
osticket.com
GNU General Public License v2.0
3.18k stars 1.65k forks source link

PDO #1647

Open ghost opened 9 years ago

ghost commented 9 years ago

Hi

Is it going to be migrated to PDO instead of MySQLi sometime soon?

This way users can, within reason, use whatever database provider they want so everyone is not limited to MySQL.

I think it would be great for osTicket.

ntozier commented 9 years ago

There may be plans to add more database compatibility, but if there is its not real high on the priority list compared to some of the other things. You could also use MariaDB.

protich commented 9 years ago

@Steve-John - we decided to go the route of ORM instead of PDO. We've already started overhauling the system to use ORM-based queries. In the near future you will be able to write drivers for any database backend of your choice.

greezybacon commented 9 years ago

I'd like to add that PDO does not add database flexibility. It merely makes executing queries and fetching results consistent across database platforms. The queries still need to be constructed specifically for the database backend. In other words, Oracle and MySQL have differing SQL dialects (see the LIMIT and OFFSET clauses of the SELECT statement), therefore, to support both Oracle and MySQL, a compiler to build queries for both platforms would be necessary. That's where the ORM comes in. It's able to build queries based on a single constraint language for both platforms. Then, PDO might be used to facilitate communicating those queries to the database server and fetching the results, so that the code to fetch the records from the database could be reused.

ghost commented 9 years ago

Yeah, "within reason". Generally MySQL to SQLite just works.