Skip to content

Data sources

Alexis DINQUER edited this page May 14, 2019 · 1 revision

Data sources handling

PPHI can handle different type of data sources (only MySQL for the moment), eg. MySQL, SQLite, File, ... and many at once.

What is a data source ?

A data source holds data of differents natures, eg. database or file systems, and it can be read and sometimes be written.

How to add a data source to my project ?

To handle a new data source with PPHI, you have to create a folder pphi\datasources and inside you put configuration file. To create configuration files, refer to the configuration files section

How to create a configuration file ?

Configuration files are in YAML format, and specific to the type of datasource as follow.

MySQL config file

For MySQL data source config file follow this template

---
type: MySQL
mysql:
  url: database.hostname
  port: 3306
  username: username
  password: password
  database: pphi_database
...

With:

  • type: The data source type, in this case MySQL (default value is mysql)
  • mysql: The specific config for MySQL
    • url : The data base url
    • port : The data base port
    • username : Username to connect to the database with the necessary rights, Do not used root user in production environment
    • password : The password linked to the username account
    • database : The database name used by PPHI