Use of PHP PDO Class

Development-related discussion, including bundled plugins
antoine
Bear Rating Trainee
Bear Rating Trainee
Posts: 1
Joined: 27 Dec 2008, 13:41

Use of PHP PDO Class

Postby antoine » 27 Dec 2008, 14:01

I was very interested by your project. I just think that the need of MySQL or PgSQL server is a little bit disproportional for the aim.

I was trying to add SQLite backend to your project. Unfortunatly, PHP PDO class does not support 2 of the db functions you are using:
- db_num_rows: I think I can write a workaround catching all the "SELECT ... FROM ..." and querying a "SELECT COUNT(...) FROM ..." to get this number
- db_fetch_result: I do not know how to simply wrap this function using the PDO class.

Do you have any plan to use PDO class instead of the native mysql/pgsql function? This would imply some changes in lots of place in the code.

You can see the very simple things I have done here:
http://git.monte-stello.com/?p=tt-rss.g ... ads/sqlite

Antoine

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: Use of PHP PDO Class

Postby fox » 27 Dec 2008, 16:38

I just think that the need of MySQL or PgSQL server is a little bit disproportional for the aim.


You are entitled to your opinion, but tt-rss uses transactions, foreign keys, cascade deletes, server-side typecasting and inline queries. All of which SQlite doesn't support.

I was trying to add SQLite backend to your project. Unfortunatly, PHP PDO class does not support 2 of the db functions you are using:


So, this sort of thing is really not the problem you should be worried about.

- db_num_rows: I think I can write a workaround catching all the "SELECT ... FROM ..." and querying a "SELECT COUNT(...) FROM ..." to get this number


Doubling the amount of queries. Nice.


Return to “Development”

Who is online

Users browsing this forum: No registered users and 1 guest