I think your uri
is not correct, read on for more details, and the correct syntax (near the end) ...
To use Forena for connecting to a database (such as Postgres, Oracle, MS SQL, etc), you need to perform the steps described in the tutorial that comes with Forena, i.e. within the Data Sources Settings). These are the supported methods for defining Data Sources:
- use the Forena configuration data (located within
admin/config/content/forena/data
), and then use the "add data source" link (=admin/config/content/forena/data/add
). There you can specify relevant options. After you select "Postgress Database" as the driver there, you'll be able to specify the remaining options within "Connection info", such as the uri
.
- use a
settings.php
file which allows for including PHP logic. Have a look at the settings.php
files for each of the samples included in Forena's subfolder repos
.
- from within a custom module, use a
forena_alter_repos hook
(documented within Available Hooks in Forena's Development Guide).
Specific to Postgres, you can connect to it in one of two ways:
- Using the Postgres native driver, connect using a
uri
that has a connection string similar to what is described in http://php.net/manual/en/function.pg-connect.php .
- Using PDO Postgres driver use a syntax that is similar to http://php.net/manual/en/ref.pdo-pgsql.connection.php .
Looking at the (first) uri
included in your question, I would specify a uri
like so:
pgsql:host=127.0.0.1;port=5432;dbname=database;user=username;password=password
Disclosure: I'm a co-maintainer of Forena.