Particle best practices
Keep inputs explicit
Section titled “Keep inputs explicit”Pass the values a function needs as arguments. Prefer a deterministic transformation that returns the same result for the same inputs. Use SQL to select and join records before applying the function.
Avoid depending on invocation count or row order. External calls and side effects need their own authorization and idempotency design. See runtime and trust.
Use application-specific names
Section titled “Use application-specific names”Choose descriptive names that do not conflict with SQL built-ins. Update callers when changing a name or signature. See names and errors.
Treat types as a contract
Section titled “Treat types as a contract”Annotate every argument and return value. Test the SQL values your application will pass, including NULLs and boundary values. Validate supported mappings with the Python guide.
Test both interfaces
Section titled “Test both interfaces”Unit-test the ordinary function, then call the loaded function through SQL. Check returned values and errors, rather than treating successful registration as proof that the implementation works. Follow testing.
Plan updates and restarts
Section titled “Plan updates and restarts”Pin the module’s dependencies and use the same environment in testing and deployment. Keep a working module available for rollback. Test startup loading and a restart before depending on the function in application queries.
This site uses Google Analytics cookies to count visits. Privacy · License