Flower Docs
  • OpenFlower overview
    • The "Hello World" tutorial
  • Videos
    • OpenFlower in 100 seconds
  • 🆕Setup and run
    • Cloud & Private Cloud
    • Self-hosting
      • Access local database or API
      • Google Cloud Platform
      • Heroku
      • Migration from Openblocks
      • Update MongoDB Versions
      • OpenFlower Version Update
      • Traefik loadbalancer
      • SMTP Server
    • Security
  • 🏨Workspaces & Teamwork
    • Workspaces
    • Members and Groups
    • Permissions for Resources
    • OAuth
      • KeyCloak
      • Google
      • GitHub
      • Generic OAuth Provider
    • Query library
    • OpenFlower Marketplace
  • ✨Build Applications
    • Create a new App
      • Modules
      • Version and Release Management
    • App Editor
      • Visual Components
        • Common Component Settings
        • File upload
        • Charts and graphs
        • Image
        • Option lists
        • List View
        • Drawer
        • Google Maps
        • Table
        • Messages / Toast
        • Calendar
      • Date handling
      • Bulk Editing
      • Layers
      • Data selection & Javascript
      • Use Markdown
      • Keyboard shortcuts
    • App Navigation
    • App Interaction
      • Event handlers
    • Themes & Styling
      • Design an efficient and user-friendly form
      • Customize Styles
      • Component Styling Possibilities
  • 🚀Connect your Data
    • Data source basics
    • Data sources in OpenFlower
      • APIs as Datasource
        • REST API
        • GraphQL
        • Google Sheets
      • SQL Databases
        • MySQL
        • MariaDB
        • PostgreSQL
        • Microsoft SQL Server
        • Oracle
      • NoSQL Databases
        • MongoDB
        • CouchDB
        • DynamoDB
      • InMemory Databases
        • Redis
      • File Storages
        • S3 File Storage
      • BigData & OLAP
        • Big Query
        • Snowflake
        • ClickHouse
        • Elasticsearch
      • Websocket Datasource
    • Query basics
      • Bind Query Data to Components
      • Query library
  • 🪄Workflows
    • n8n Integration
  • 💫Business Logic in Apps
    • Write JavaScript
      • JavaScript query
      • Temporary state
      • Transformers
      • Data responder
      • Built-in JS functions
  • 🙌Publish Apps
    • Share an App
    • Publish an App
    • Embedd an App
      • Embed Apps in React
      • Native embed SDK
        • Build the SDK from Source
  • 🔥OpenFlower Extension
    • Opensource Contribution
      • Develop UI components for Apps
      • Develop Data Source Plugins
    • Use third-party libraries in Apps
      • Day.js Date handling
      • Import your own JavaScript Library
    • Custom component
    • OpenFlower Open REST API
Powered by GitBook
On this page
  • Features
  • Create a new query
  • Input parameters
  • Version management
  • Publish
  • History version
  • Import a query
  • Permissions
  1. Connect your Data
  2. Query basics

Query library

Query Library lets you store, reuse and share data queries for data sourced across your workspace. Create and run queries in query library, and call them from any OpenFlower app.

Features

The main function of the query **** library is to create and manage reusable queries:

  • Writing queries based on data sources, with the ability to define Inputs variables.\

  • Importing and triggering queries from query library in apps and modules.\

  • Referencing different versions of queries.\

Create a new query

  1. Click + New and select a data source.

  2. Rename the query on demand.

  3. Write code and click ▶ Run to get results. The results will display in the bottom pane of the window.

Input parameters

There are cases where you want to pass dynamic parameters to a query. OpenFlower supports that by introducing input configuration of a query.

Click Add in the Inputs tab in the right pane to add input parameters. Reference them using {{}} in the query, then you can input test values to test execution of the query.

You can only reference variables instead of writing JavaScript code in {{}}.

To edit the name and description of the input variables, click ... and select Edit or directly click the title of the variable.

Version management

Queries may be updated on demand. You can make an adjustment to a query to a newer version and at the same time maintain the older version. Such version management is achievable in query library. Click ··· in the top right corner to publish different versions of queries, and you can view and restore history versions.

Publish

History version

To view and restore the history versions, go to ··· > History version.

You can restore your current draft to a history version by selecting the target version from the history version list and clicking Restore this version. Click Exit to return to edit mode.

Import a query

  1. In an app or module, Click + New in the Query editor in the bottom pane, then select Import from Query Library.

  2. Select a query from the library from the dropdown list, choose your desired version and pass in corresponding input parameters.

For other settings, see .

Permissions

Workspace Admin and members of Developers group have access to the Query Library and have read and write permissions to all queries in the library.

PreviousBind Query Data to ComponentsNextWorkflows

Last updated 7 months ago

When you finish writing a version of the query, you can publish it. Click ··· > Publish. Use (also known as SemVer) to name your version.

🚀
semantic versioning