Connect URLs

DB-All.e can work with several storage backends, identified via a URL.

This is how to connect via URL using various ways of working with DB-All.e. dbtype://info is a placeholder for the connetion URL, that is documented below.

Specifying the URL directly:

Fortran:

ierr = idba_connect(dbhandle, "dbtype://info")

dbadb:

dbadb --dsn="dbtype://info" import …

provami:

provami "dbtype://info"

python:

db = dballe.DB.connect("dbtype://info")

Specifying the URL via an environment variable:

# Export the environment variable
export DBA_DB="dbtype://info"

Fortran:

ierr = idba_connect(dbhandle, DBA_MVC)

dbadb:

dbadb import …

provami:

provami

python:

db = dballe.DB.connect(os.environ["DBA_DB"])

URL syntax

For SQLite

SQLite URLs need only specify the .sqlite file name.

They can be either in the form sqlite:file.sqlite or sqlite://file.sqlite.

If the environment variable DBA_INSECURE_SQLITE is set, then SQLite access will be faster but data consistency will not be guaranteed.

For PostgreSQL

DB-All.e uses standard PostgreSQL connection URIs. For example: postgresql://user@host/db

See the PostgreSQL documentation for the complete documentation.

For MySQL

DB-All.e uses a MySQL connection URL with a syntax similar to the one used by the JDBC connector:

mysql://[host][:port]/[database][?propertyName1][=propertyValue1][&propertyName2][=propertyValue2]...

The only property names currently used by DB-All.e are user and password; the rest are ignored.

For example: mysql://host/db?user=username&password=secret

URL actions

?wipe=yes/true/1

You can add a wipe query string argument to the connection URL to have DB-All.e create or recreate the database on connection.

You can also use ?wipe without argument. Note that ?wipe= with an empty argument also triggers a wipe.