Skip to content
ParticleDB
Release candidateParticleDB 1.1.19-rc.17 is not yet GA or ready for production data.Release status →

Load and deploy Particles

Both methods need Python 3.11 or newer with the particledb package, as python3 on the PATH or named by PDB_PARTICLES_PYTHON. See requirements.

Add --python-functions to the start command. It accepts a module file, a package directory or a dotted module name, and can be repeated:

Terminal window
particledb start --data-dir ./pdb-particles --python-functions ./tools.py

Use tools.py from your first Particle, and bind the listeners as in the quickstart. Startup loading registers the functions for that server process only: start the server with the same flags every time. A restart without --python-functions does not have the functions.

SELECT priority(0.9, 0.8) AS score;

If the server did not start, read its startup error: a missing interpreter, a missing particledb package, a failed import in the module and a name collision are each reported with the module path.

Check a module without a server. This prints each function’s SQL signature:

Terminal window
particledb particles verify ./tools.py

particledb particles deploy registers the functions on a running server through its SQL client address. A deployed function survives a restart without --python-functions:

Terminal window
particledb particles deploy ./tools.py --target 127.0.0.1:5432 --yes

Run particledb particles deploy --help for the other options.

Test a change on a disposable server first. Validate its inputs, outputs, dependencies and any stored results that depend on its old behavior. Keep a previous version of the module available for rollback.

Restart a test server with your production start command and call the function again before depending on it in application queries.

Documentation home · Troubleshooting