Do you have some feature in mind that you'd love to see in Couch? Let us know.
12 posts Page 1 of 2
SQLite is a very solid and capable database, which can be extremely useful in small-to-medium website backends (Drupal uses it). It is quite common and pervasive, bundled with PHP (from 5.3), and is pre-installed on many operating systems by default - including MacOS X.

I manage several OS X Servers, for various companies. OS X Server comes out-of-the-box with PostgreSQL, as well as SQLite, under the hood.

While it is possible to instal MySQL on a OS X Server, I do feel that for most of these clients, installing a mega-DBMS just to support their blog site is overkill, and could potentially introduce issues and make the server configuration and management more laborious and difficult for us.

I would truly love to use CouchCMS for these Server clients, but unfortunately, the MySQL requirement makes it a no-go for me.

Is there any chance of providing support for SQLite in a future version?

Many thanks for your consideration, and please, keep up the good work!
Hello and welcome, luxlogica :)

I see you have posted several suggestions and each of them is valuable.
Thank you very much indeed.
We'll definitely keep them in mind as Couch progresses through the next versions.

Thanks again and do keep the suggestions coming.
Supporting SQLite and others (http://php.net/manual/en/pdo.drivers.php) would presumably require migrating all of the database interaction from the mysql extension to PDO. In the long run this might be necessary regardless - the mysql extension is deprecated as of PHP 5.5 and thus scheduled for removal.
I am thrilled to hear that support for SQLite is in the cards! :D

MySQL installation on MacOS X requires over 600Mb of space, and it is necessary to instal system extensions and daemons that constantly run in the background and consume valuable system resources. But the worst part of it is, that when Apple upgrades the system software, they overwrite php config files (along with the system's), and it breaks the database. This means that after every system upgrade, the MySQL connection has to be reconfigured. This is already a chore when you have to do it for one computer - plagued with possible problems that may arise along the way, and that are difficult to troubleshoot. But when you have to handle upgrading *several* servers, it quickly becomes a total no-no.

Once again, thank you very much for listening, and for your work in this amazing CMS.
I would like to try and lend a hand to bring SQLite compatibility to Couch sooner rather than later. I am, however, a bit hesitant to offer help, as PHP is not my 'forte', and I'm certain that my coding would have to be triple-checked and tested...

I had a quick look at the 'db.php' file, that seems to hold the main database class (KDB), and the database-related functions. Thankfully, it is a relatively short file, with only a handful of functions, so it should not be too much trouble to port the 'mysql_' code to use the newer PDO functions.

I did notice, however, a couple of points that may require more careful thinking - and as these seem to be architectural/system design issues, I thought I'd bring them to the attention of the Couch Gods, so a suitable decision can be made. :

1) The 'sanitize' function is used directly by several other classes throughout the code - in over 300 places. PDO does have an equivalent function, that sanitises content based on the requirements of the underlying database used (the way that data has to be sanitised varies slightly from database to database). The PDO documentation, however, advises *against* using 'chunks' of sanitised code, and hand-building SQL queries. It enables the programmer to define a parameterised SQL query, which gets cached by PHP, and in which the programmer can inject variables that get automatically sanitised. This not only makes the whole system faster (because of query caching), but greatly reduces the amount of code to maintain (think about getting rid of all those 300+ 'sanitize' calls).

2) PDO has functions that automatically handle transactions, if the underlying database supports it (and most databases do, with the notable exception being MySQL when using outdated storage engines). It may be easier, better and safer to substitute the KDB transaction calls with the PDO-based ones.

3) There is a 'raw_select' function, which seems to be used in only one place in the entire code (in 'ajax.php'). It seems to accept 'raw' sql and use it directly on a database query. I did not investigate the ajax.php code any further, but would it be possible to get rid of this function, and perhaps substitute it with a normal parameterised query?

I humbly suggest that we could initially try simply replacing the current 'mysql_' code in 'db.php' with the equivalent PDO functions, which may already enable immediate use of Couch with other databases - and I could certainly help with this.

Unfortunately, this may not work, because it seems that some of the SQL code is actually being created by other classes outside KDB - i.e., in the 'ajax.php' file, or perhaps in the other places throughout the code where 'sanitize' is being used. If that is the case, then the SQL that is being produced may end up being too specific for MySQL alone, and then all these functions will have to be reworked, before the code can truly take advantage of PDO's cross-database compatibility - I'm afraid I haven't looked at the code thoroughly enough to know for sure.

In any case, if you believe this is something worth investing some time in, I would be happy to lend a hand, even if it is using my rather limited capabilities! If that is the case, do let me know what the procedure is for contributing code - i.e., is there a GitHub repository - and I'll try to get started!
I had a further look into the code, and studied the PDO docs, as well as this:

http://wiki.hashphp.org/PDO_Tutorial_fo ... Developers

There are, in a 'vanilla' installation of Couch (with no extra add-ons installed), 318 calls to "mysql_*" functions. Following the procedures outlined in the PDO docs and the tutorial above, I believe that we could switch over all the functions in the entire codebase to using PDO - and provide support to SQLite immediately - with only about 1 or 2 days' worth or work.

As mentioned in the post above, I am willing to put in the work, but I need some response/feedback, as to whether this is something needed/wanted, or whether this would be more of a nuisance for you guys right now - ie., you may be too busy with other things (such as the release of 1.4.5) to be able to give this any priority at all.

Also, I do not know what the procedure is for contributing code, and there are no instructions anywhere to assist...
Hi luxlogica,

But of course your contribution would be more than welcome :)

I'll get back soon with details on the process.

Thanks.
Hi there,

I'm new to Couch, but it looks great so far.

I was just wondering if SQLite is now supported?
Looking around the docs I only see reference to MySQL.

Thanks loads.
@TMurNGon, Hi :)

I am sorry but Sqlite is not supported as yet.
Thanks for the reply KK.
Any plans for this in the future?
12 posts Page 1 of 2