Registry / database / directus-extension-bundle-postgres-function-report

directus-extension-bundle-postgres-function-report

JSON →
library1.11.0jsnpmunverified

A Directus extension bundle (v1.11.0) that adds a button interface and an API endpoint for issuing downloadable reports (XLSX, CSV, JSON) from PostgreSQL functions. It is designed for teams that already have report logic in SQL and want to avoid custom API code. The extension automatically generates report endpoints based on Directus collection names, passes form fields as PostgreSQL function arguments, and supports header translation with accent replacement. Being a Directus bundle, it must be placed in the `extensions` directory and cannot be installed via npm for use in other projects.

npm install directus-extension-bundle-postgres-function-report
INSTALL
IMPORT
SIG · DIRECTUS-EXTENSION
D
directus-extension-bundle-postgres-function-report
databasejavascriptv1.11.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

postgres-function-report-button
// This is a Directus bundle extension; it is not imported via npm. // Place the entire bundle folder inside Directus `extensions` directory.
npm install directus-extension-bundle-postgres-function-report
Directus bundles must be manually placed in the extensions folder and cannot be installed from npm. See Directus documentation on extensions.

Installation and basic usage of the Directus extension bundle for PostgreSQL function reports.

// This is a Directus extension bundle, not a library. Quickstart is about installation. // 1. Download or clone the bundle into <directus-project>/extensions/directus-extension-bundle-postgres-function-report // 2. Restart Directus // 3. Create a collection named after a PostgreSQL function (e.g., `issue_report_customer_attendance`) // 4. Add fields matching the function arguments (e.g., `customer`, `start_date`, `end_date`) // 5. Add a new field with interface "Postgres Function Report Button" // 6. Clients can then call: // GET /postgres-function-report-issuer/issue_report_customer_attendance?customer=123&start_date=2024-01-01&end_date=2024-12-31 // Optionally add `&meta_type=csv` or `&meta_type=json` (default is xlsx)
Debug
Known issues
gotchaThe bundle must be placed in the extensions directory; npm install does not work.
fix
Place the bundle folder in <directus-root>/extensions/directus-extension-bundle-postgres-function-report.
affects: >=1.0.0
breakingFields prefixed with `meta_` are reserved and cannot be used as PostgreSQL function arguments.
fix
Avoid naming any collection field with a `meta_` prefix; use `meta_type`, `meta_collection`, etc. only for endpoint control.
affects: >=1.0.0
gotchaThe button interface uses the collection name as the default PostgreSQL function name; if the function name differs, you must set `Report Function Name` on the interface.
fix
Explicitly set `Report Function Name` on the button interface settings.
affects: >=1.0.0
deprecatedAutomatic header translation might produce incorrect results for non-Portuguese languages; the accent replacement logic is Portuguese-specific.
fix
Disable 'Auto translation' or provide explicit translations in Directus field settings.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'directus-extension-bundle-postgres-function-report'
Trying to import the bundle as an npm package in code.
fix
Directus extension bundles are not importable via npm. Place the bundle folder in the extensions directory.
404 Not Found: /postgres-function-report-issuer/...
The bundle is not installed correctly or Directus extensions are not enabled.
fix
Verify the bundle folder is in extensions/ and restart Directus. Check Directus docs for enabling extensions.
Function ... does not exist (SQL: SELECT * FROM public.issue_report_customer_attendance(...))
The PostgreSQL function name does not match the collection name or Report Function Name setting.
fix
Ensure the function exists in the public schema and the name matches exactly.
Upgrade
Version history
1.11.0latest on npm
Audit
Dependencies
directusrequiredRuns as a Directus extension; requires Directus instance with extension system enabled.
Agent activity
6 hits · last 30 days
node
6
Resources
directus-extension-bundle-postgres-function-report — npm install directus-extension-bundle-postgres-function-report · libregistry