I was excited as I recently discovered Backdrop and I'm now evaluating it as potential upgrade for several Drupal 7 sites - some of them need access to a PostgreSQL database (in custom modules).
I understood that Backdrop core only works on MySQL, but the documentation suggests that it is possible to use other external databases (see https://docs.backdropcms.org/documentation/database-configuration#other-...).
However, I did not succeed in accessing my external database. If I follow the documentation exactly, I get the following error message:
$result = db_query("SELECT * FROM mytablename", array('target' => 'mydatabase')); SQLSTATE[42S02]: Base table or view not found: 1146 Table 'backdrop.mytablename' doesn't exist: SELECT * FROM mytablename; Array ( [target] => mydatabase )
It seems that the target option is completely ignored, as it tries to access the backdrop core database.
It seems that the given example for db_query is wrong, as options should be the third, not the second parameter.
But even when I change the call to db_query and add an empty array as the second (args) parameter, the result is the same (only that the array in the error message is empty).
Has anybody succeeded in connecting Backdrop to an external database? Looking at the code, it does not look like it is possible. But I was just hoping for it as the documentation clearly provides this option.
OK, I added a bug report here: https://github.com/backdrop/backdrop-issues/issues/5510
I would also submit an issue for the documentation error, but that's not a bug or any other issue category available (or?): https://github.com/backdrop/backdrop-issues/issues/new/choose
How to do that?
Related to Silkscreen: with all respect to that project, but a fork of a fork is in my understanding not the most sustainable way to keep an existing feature.
As you can see in my bug report, I tested to simply add the Drupal 7 pgsql driver and it seems to be possible to integrate it into Backdrop.
So, I'm hoping that I'm not the only person in the world who is looking into Backdrop and still using Drupal 7 with external PostgreSQL databases (and experiencing that also Drupal 9 is not ready for it, e.g. https://www.drupal.org/project/drupal/issues/1060476). I can really understand why Backdrop dropped PostgreSQL support from core, because not many contrib developers are willing and able to support different database types. But complete disconnection from non mysql databases would be a big loss in usage options for Backdrop, I think.