Why do we use “databases”?¶
We use database to store data while we run the tests. When globally talking about databases, we are indirectly talking about the following subsystems.
There is a different for what we are talking about here and the
--database argument which only enable/disable the InactiveDB
How do we manage them?¶
They consist of simple JSON files which are read and updated on the fly.
Warnings around Database (self) management¶
If you plan to delete everything and still manage to use PyFunceble in the
future, please use the
Indeed, it will delete everything which is related to what we generated except things like the whois database file/table which saves (almost) static data which can be reused in the future.
Actually, deleting for example the whois database file/table will just make your test run for a much longer time if you retest subject that used to be indexed into the whois database file/table.
2.0.0 (equivalent of
we offer multiple database types which are (as per configuration)
Why different database types?¶
With the introduction of the multiprocessing logic, it became natural to introduce other database format as it’s a nightmare to update a JSON formatted file.
In order to write or use a JSON formatted database, we have to load it and overwrite it completely. It’s great while working with a single CPU/process but as soon as we get out of that scope it become unmanageable.
How to use the
- Create a new user, password and database (optional) for PyFunceble to work
- Create a
.pyfunceble-envfile at the root of your configuration
- Create a
- Complete it with the following content (example)
PYFUNCEBLE_DB_CHARSET=utf8mb4 PYFUNCEBLE_DB_HOST=localhost PYFUNCEBLE_DB_NAME=PyFunceble PYFUNCEBLE_DB_PASSWORD=Hello,World! PYFUNCEBLE_DB_PORT=3306 PYFUNCEBLE_DB_USERNAME=pyfunceble
2.4.3.dev it is possible to use the UNIX socket
PYFUNCEBLE_DB_HOST environment variable.
The typical location for
This have been done to make:
- It easier to use it in conjunction with a supported CI
- Leaving more space on the IP-stack on local DB installations.
UNIX:SOCKETis usually faster than the IP connection on
- local runs.PYFUNCEBLE_DB_CHARSET=utf8mb4 PYFUNCEBLE_DB_HOST=/var/run/mysqld/mysqld.sock PYFUNCEBLE_DB_NAME=PyFunceble PYFUNCEBLE_DB_PASSWORD=Hello,World! PYFUNCEBLE_DB_PORT=3306 PYFUNCEBLE_DB_USERNAME=pyfunceble
- Switch the
db_typeindex of your configuration file to
- Switch the
- Play with PyFunceble!
If the environment variables are not found, you will be asked to prompt the information.