Acquiring URLsΒΆ

Nomad supports few different ways of specification how it should connect to database.

There are two parameters it has to acquire: engine and url.

Engine is specified as a string. Supported engines right now consist of dbapi and sqla. Both of them support SQLite, MySQL and PostgreSQL databases, the first one requiring only db api modules and second one requiring SQLAlchemy library.

URL can be specified in few different ways:

  • url - just a string, path like sqlite:///test.db or mysql://user:pass@host/db
  • url-python - taking variable from Python module, has two approaches to fetching python module:
    • From sys.path, when it looks like one: yourapp.settings:dburl
    • From filesystem, when it looks like path to file: ../settings.py:dburl
  • url-file - taking contents of a file: ../dburl.txt
  • url-command - taking output of a command: grep mysql ../settings.txt

Note

Look at URL acquiring test to see how various options are used.