GithubHelp home page GithubHelp logo

7span / directus-extension-custom-query-panel Goto Github PK

View Code? Open in Web Editor NEW
37.0 3.0 3.0 1.57 MB

An easy to use insight panel to see custom raw query data from database

JavaScript 77.18% Vue 22.82%
directus directus-panel-quest directus-extension

directus-extension-custom-query-panel's Introduction

Directus Custom Query Panel

Behold 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! πŸ’ΎπŸŽ‰

Details

  • Execute custom SQL queries directly from the panel.
  • Use dynamic parameters to reuse queries with different values.
  • Display query results in a simple tabular structure for easy readability.
  • Enhance data visibility and understanding by enabling users to extract meaningful insights from their data which is crucial for CRM and data-driven applications.

πŸ‘€Set Up Instructions

NOTE: Replace localhost:8055 with your domain

curl --location --request POST 'http://localhost:8055/custom-query-panel/create-table'
  • Table named cqp_queries will be available in your project.

How To use This Extension

  1. Create the queries in the table (cqp_queries) as explained in below example.
select first_name, last_name from employees where department = ${department} 
  1. This extension provides support of global variables added in insights like department or week.
  1. Use variables field give in panel settings below fields.
  1. Use double mustache syntax for entering value field to get value from variables.

πŸ‘€ Environment Variables

  • You can provide collection name in CUSTOM_QUERY_COLLECTION as per your needs.
  • It Also provide support for custom query length using CUSTOM_QUERY_FIELD_LENGTH
# default value CUSTOM_QUERY_COLLECTION = "cqp_queries" 
CUSTOM_QUERY_COLLECTION="custom_query"
# default value CUSTOM_QUERY_FIELD_LENGTH = 5000 
CUSTOM_QUERY_FIELD_LENGTH=10000

Problem

  • Getting data from database query and show it in a insights panel was missing.

  • The ability to extract and display data from a database query within an insights panel is crucial for CRM and data-driven applications.

  • Insights panels serve as a hub for users to access valuable information, gain actionable insights, and make informed decisions.

  • 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.

Extension Type

  • πŸ“¦ Bundle ( Panel + Custom Endpoint )

Screenshots

Add Query Department Example dynamic-fields Adding File Label Alt text

Collaborators

Contact Details

🚧 Please note

  • this extension uses raw query. Use with caution. It might do uninteded actions.
  • Roles and permission check for query

Table Fields

  • We have repeater interface with multiple columns support

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.