{"id":42637,"library":"directus-extension-bundle-postgres-function-report","title":"Directus Extension Bundle: Postgres Function Report","description":"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.","status":"active","version":"1.11.0","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","directus-extension"],"install":[{"cmd":"npm install directus-extension-bundle-postgres-function-report","lang":"bash","label":"npm"},{"cmd":"yarn add directus-extension-bundle-postgres-function-report","lang":"bash","label":"yarn"},{"cmd":"pnpm add directus-extension-bundle-postgres-function-report","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Runs as a Directus extension; requires Directus instance with extension system enabled.","package":"directus","optional":false}],"imports":[{"note":"Directus bundles must be manually placed in the extensions folder and cannot be installed from npm. See Directus documentation on extensions.","wrong":"npm install directus-extension-bundle-postgres-function-report","symbol":"postgres-function-report-button","correct":"// This is a Directus bundle extension; it is not imported via npm.\n// Place the entire bundle folder inside Directus `extensions` directory."}],"quickstart":{"code":"// This is a Directus extension bundle, not a library. Quickstart is about installation.\n// 1. Download or clone the bundle into <directus-project>/extensions/directus-extension-bundle-postgres-function-report\n// 2. Restart Directus\n// 3. Create a collection named after a PostgreSQL function (e.g., `issue_report_customer_attendance`)\n// 4. Add fields matching the function arguments (e.g., `customer`, `start_date`, `end_date`)\n// 5. Add a new field with interface \"Postgres Function Report Button\"\n// 6. Clients can then call:\n//    GET /postgres-function-report-issuer/issue_report_customer_attendance?customer=123&start_date=2024-01-01&end_date=2024-12-31\n//    Optionally add `&meta_type=csv` or `&meta_type=json` (default is xlsx)","lang":"typescript","description":"Installation and basic usage of the Directus extension bundle for PostgreSQL function reports."},"warnings":[{"fix":"Place the bundle folder in <directus-root>/extensions/directus-extension-bundle-postgres-function-report.","message":"The bundle must be placed in the extensions directory; npm install does not work.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Avoid naming any collection field with a `meta_` prefix; use `meta_type`, `meta_collection`, etc. only for endpoint control.","message":"Fields prefixed with `meta_` are reserved and cannot be used as PostgreSQL function arguments.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Explicitly set `Report Function Name` on the button interface settings.","message":"The 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.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Disable 'Auto translation' or provide explicit translations in Directus field settings.","message":"Automatic header translation might produce incorrect results for non-Portuguese languages; the accent replacement logic is Portuguese-specific.","severity":"deprecated","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'accent':73 'add':13 'alreadi':37 'api':19,48 'argument':67 'automat':52 'avoid':46 'base':56 'bundl':3,10,78 'button':15 'cannot':88 'code':49 'collect':59 'csv':26 'custom':47 'design':33 'directori':86 'directus':1,8,58,77,100 'directus-extens':99 'download':23 'endpoint':20,55 'extens':2,9,51,85,101 'field':63 'form':62 'function':5,30,66 'generat':53 'header':70 'instal':90 'interfac':16 'issu':22 'javascript':98 'json':27 'logic':40 'must':80 'name':60 'npm':92 'pass':61 'place':82 'postgr':4 'postgresql':29,65 'project':97 'replac':74 'report':6,24,39,54 'sql':42 'support':69 'team':35 'translat':71 'use':94 'v1.11.0':11 'via':91 'want':44 'xlsx':25","created_at":"2026-06-05T16:55:56.161466+00:00","updated_at":"2026-06-05T16:55:56.161466+00:00","problems":[{"fix":"Directus extension bundles are not importable via npm. Place the bundle folder in the extensions directory.","cause":"Trying to import the bundle as an npm package in code.","error":"Error: Cannot find module 'directus-extension-bundle-postgres-function-report'"},{"fix":"Verify the bundle folder is in extensions/ and restart Directus. Check Directus docs for enabling extensions.","cause":"The bundle is not installed correctly or Directus extensions are not enabled.","error":"404 Not Found: /postgres-function-report-issuer/..."},{"fix":"Ensure the function exists in the public schema and the name matches exactly.","cause":"The PostgreSQL function name does not match the collection name or Report Function Name setting.","error":"Function ... does not exist (SQL: SELECT * FROM public.issue_report_customer_attendance(...))"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":"directus-extension-bundle-postgres-function-report","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-05","next_check":"2026-09-03","install_tag":null}}