{"id":20219976,"url":"https://github.com/7span/directus-extension-custom-query-panel","last_synced_at":"2025-04-10T16:03:30.671Z","repository":{"id":204504424,"uuid":"671345896","full_name":"7span/directus-extension-custom-query-panel","owner":"7span","description":"An easy to use insight panel to see custom raw query data from database","archived":false,"fork":false,"pushed_at":"2023-12-15T20:00:56.000Z","size":1610,"stargazers_count":43,"open_issues_count":4,"forks_count":3,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-02T22:59:56.861Z","etag":null,"topics":["directus","directus-extension","directus-panel-quest"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/7span.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-07-27T05:42:50.000Z","updated_at":"2025-01-20T11:01:45.000Z","dependencies_parsed_at":"2023-11-29T06:28:19.162Z","dependency_job_id":"29bb5d5a-c797-48ef-9b1f-8c194fb34d06","html_url":"https://github.com/7span/directus-extension-custom-query-panel","commit_stats":null,"previous_names":["7span/directus-extension-custom-query-panel"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/7span%2Fdirectus-extension-custom-query-panel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/7span%2Fdirectus-extension-custom-query-panel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/7span%2Fdirectus-extension-custom-query-panel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/7span%2Fdirectus-extension-custom-query-panel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/7span","download_url":"https://codeload.github.com/7span/directus-extension-custom-query-panel/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248249507,"owners_count":21072379,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["directus","directus-extension","directus-panel-quest"],"created_at":"2024-11-14T06:44:28.221Z","updated_at":"2025-04-10T16:03:30.626Z","avatar_url":"https://github.com/7span.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Directus Custom Query Panel\n\nBehold the magic 🎩✨ of our simple panel! View your data without the hassle of writing custom endpoints or preparing views - it's like having your cake 🍰 and eating it too, but for data! 💾🎉\n\n\n## Details\n\n- Execute custom SQL queries directly from the panel.\n- Use dynamic parameters to reuse queries with different values.\n- Display query results in a simple tabular structure for easy readability.\n- Enhance data visibility and understanding by enabling users to extract meaningful insights from their data which is crucial for CRM and data-driven applications.\n\n\n## 👀Set Up Instructions\n\n- Either install through NPM [npm install @7span/directus-extension-custom-query-panel](https://www.npmjs.com/) or [Installing Through the Extensions Folder](https://docs.directus.io/extensions/installing-extensions.html#installing-through-the-extensions-folder).\n- Once Installed/configured extension you need hit the below curl request to create a default table(`cqp_queries`) to store the queries.\n\n**NOTE**: Replace `localhost:8055` with your domain\n\n```bash\ncurl --location --request POST 'http://localhost:8055/custom-query-panel/create-table'\n```\n\n-   Table named `cqp_queries` will be available in your project.\n\n## How To use This Extension\n\n1.  Create the queries in the table (`cqp_queries`) as explained in below example.\n\n```bash\nselect first_name, last_name from employees where department = ${department} \n```\n\u003c!-- ![Add Query](/images/add-query.png) --\u003e\n\n2.  This extension provides support of *`global variables`* added in insights like department or week.\n\u003c!-- ![Department Example](/images/department-panel.png) --\u003e\n\n3.  Use `variables` field give in panel settings below `fields`.\n\u003c!-- ![dynamic-fields](/images/dynamic-fields.png)\n![Adding File Label](/images/file-label.png) --\u003e\n\n4.  Use `double mustache` syntax for entering `value` field to get value from variables.\n\u003c!-- ![Alt text](/images/double-mustache.png) --\u003e\n\n## 👀 Environment Variables\n- You can provide collection name in CUSTOM_QUERY_COLLECTION as per your needs.\n- It Also provide support for custom query length using CUSTOM_QUERY_FIELD_LENGTH\n```bash\n# default value CUSTOM_QUERY_COLLECTION = \"cqp_queries\" \nCUSTOM_QUERY_COLLECTION=\"custom_query\"\n# default value CUSTOM_QUERY_FIELD_LENGTH = 5000 \nCUSTOM_QUERY_FIELD_LENGTH=10000\n```\n\n\n## Problem\n\n-   Getting data from database query and show it in a insights panel was missing.\n\n-   The ability to extract and display data from a database query within an insights panel is crucial for CRM and data-driven applications.\n-   Insights panels serve as a hub for users to access valuable information, gain actionable insights, and make informed decisions.\n-   This feature bridges the gap between raw data stored in the database and its meaningful interpretation, making Directus an even more versatile platform for managing customer relationships and data-driven business operations.\n\n## Extension Type\n\n-   📦 Bundle ( Panel + Custom Endpoint )\n\n## Screenshots\n\n![Add Query](/images/add-query.png)\n![Department Example](/images/department-panel.png)\n![dynamic-fields](/images/dynamic-fields.png)\n![Adding File Label](/images/file-label.png)\n![Alt text](/images/double-mustache.png)\n## Collaborators\n\n-   [Harsh Kansagara](https://github.com/theharshin)\n-   [Jay Bharadia](https://github.com/jay-p-b-7span)\n-   [Bhagyesh Radiya](https://github.com/bhagyesh-7span)\n\n## Contact Details\n\n-   [Linkedin](https://www.linkedin.com/company/7span)\n-   [Gmail](mailto:yo@7span.com)\n\n## 🚧 Please note\n\n-   this extension uses raw query. Use with caution. It might do uninteded actions.\n-   Roles and permission check for query\n\n### Table Fields\n\n-   We have repeater interface with multiple columns support\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F7span%2Fdirectus-extension-custom-query-panel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F7span%2Fdirectus-extension-custom-query-panel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F7span%2Fdirectus-extension-custom-query-panel/lists"}