Platform Documentation

Queries

Home Page

What are queries?

The Queries section in Bing CMS provides a powerful yet simple way to interact with your database. Create custom tables, populate them with data, and retrieve information efficiently. Our intuitive interface eliminates the need for extensive technical knowledge, making database operations accessible to everyone.

Bucket Lookup

  1. In the bucket drop-down menu, choose the "bucket" of your choice.
  2. After you select the bucket of your choice, you can create a new query.

buckets_dropdown_docs

"Buckets Drop-down Menu"

Queries Main Page

The queries consists of several fields, listed below:

  1. Name - It displays the name of the query you've created.

  2. Status - It shows the status of your query.(Published, Draft ,etc.)

  3. Tags - You can add tags to your queries, to quickly access the information that you've stored.

  4. Owner - These show all the queries that you've created in your Buckets section of the website.

  5. Deployed Date - It displays the date on which query was deployed.

  6. Deployed By - It displays the date on which the final query was deployed.

  7. Created(Date & Time) - It displays the date on which a particular document is created.

  8. Last Updated(Date & Time) - It displays the date you make changes to your query.

"Queries main page" queries_main_page

Open Query

  1. Navigate to the Queries section from the left panel of the Bing CMS dashboard.
  2. At the top-left corner, select your preferred bucket.
  3. Click + New Query to open the document creation dialog.

new_query_button

Creating a New Query

  1. Click the "+New Query" button to initiate the process of creating a new query.
  2. A dialog box will appear after clicking the button.
  3. The first field is a drop-down menu where you can select the desired data bucket.
  4. The second entry displays the total number of queries available.
  5. The third field shows the query limit, indicating the maximum number of queries you can create.
  6. The fourth entry is an input field where you can name your query.
  7. The final option allows you to assign tags, making it easier to organize, access, and retrieve your data

new_query_tab

Editing a Document

edit_button

  1. To edit a document, click the Edit button in the top-right corner of the document view.
  2. Make necessary changes to the content and update any fields within your selected query.
  3. Expand the view by clicking the Expand tab appropriate button if needed.
  4. Once edits are complete, click Save to confirm the changes.
  5. The document is ready for publication.

Designing Queries

  1. To create a new query, click the "+New Query" button. This will allow you to define a custom query.
  2. To add or modify fields, click the "Edit" button located at the top-left corner of the Queries tab.
  3. In the drop-down menu, you can select commands. Common SQL-like commands such as SELECT, INSERT, UPDATE, and DELETE are available for selection.
  4. To specify a target field or bucket, choose the appropriate field from the drop-down menu under the target selection.
  5. For specifying a data source or filter criteria, select SQL-like keywords such as FROM, WHERE, ORDER BY, or GROUP BY from the corresponding drop-down options.
  6. Enter the desired value in the designated field. This field allows you to input the data or parameter relevant to your query.
  7. You can also specify the operation you wish to perform on the selected field or dataset, such as conditions in the WHERE clause or functions in the SELECT statement.
  8. Define whether the input value is static (fixed) or dynamic (based on user input or external data).
  9. Before execution, you can preview the query in the preview pane located on the right-hand side of the Queries section. This allows you to verify the correctness of your query before running.
  10. After designing the query you can click on the save and test in query tab

save_and_play

my_field_design

Queries Playground

REST API Interface

A REST API (Representational State Transfer Application Programming Interface) is a set of rules that allows different software systems to communicate with each other over the web, usually using HTTP. REST is an architectural style that defines how web services should be designed and structured.

Here are some key points about REST APIs:

Client-Server Architecture: REST follows a client-server model where the client (e.g., a web browser or mobile app) sends requests to the server, and the server sends back responses. The server handles the data and operations, while the client displays the results.

Stateless: Each request from a client to a server must contain all the information needed to understand and process the request. The server does not store any client context between requests. This means each request is independent.

Resources: In REST, everything is considered a resource, which can be identified by a URL. For example, a user might be a resource located at /users/1, where 1 is the user ID.

HTTP Methods: REST APIs commonly use standard HTTP methods to perform actions on resources:

rest_api_tab

GraphQL Interface

Adjacent to the REST API button, click on the Playground button to access the GraphQL interface.

  • GraphQL is a powerful query language designed specifically for APIs. It allows you to query your API in a flexible, declarative manner.
  • Unlike REST, GraphQL is not tied to a specific database or storage engine. Instead, it provides an abstraction layer that interacts with your API's logic, enabling you to specify exactly what data you need.
  • With GraphQL, you can request multiple resources in a single query, improving efficiency and reducing the number of requests to the server.
  • Additionally, GraphQL's schema-based approach ensures that all data requests and mutations adhere to a well-defined structure, minimizing errors and providing a robust query mechanism.

Key Features of the Queries Playground

  • Real-Time Query Execution: Instantly see the results of your queries in both REST and GraphQL modes. This real-time feedback allows for immediate validation and debugging of queries.
  • Flexible Query Options: Both REST and GraphQL are supported, providing flexibility based on the type of API interaction required. REST offers a more traditional request-response mechanism, while GraphQL enables more granular control over the data returned.
  • Query Persistence: Save your queries for future execution or modification using the Save feature, streamlining workflow and enhancing efficiency for recurring tasks.

graph_ql_options

Playground Panel

  1. Documentation Explorer - It helps to create and save all related queries together.

  2. Show History - History option is available for the user to get all records of the queries.

  3. Re-fetch GraphQL schema - GraphQL schema describes a particular query, clients can use to fetch data. GraphQL isn’t tied to any specific database or storage engine, and is instead backed by your existing code and data.

  4. Open short keys dialog - This dialog helps contains all the shortcuts, add maps and keymaps which are assigned to a key dialog.

  5. Open settings dialog - This menu contains several options namely Persist Headers, Theme, and clear storage.

Playground has various features, listed below:

  1. Run query button - This helps run the query.
  2. Prettify query button - This helps make the query statements more concise and beautify your code.
  3. Merge fragments into query button - This helps merge table contents using this option.
  4. Copy query button - It helps copy the query that you've created.

playground_tab

What are headers?

Headers refer to the column names or labels in the result set of a query. When you run a SQL query, the result is typically displayed in a tabular format. Here, each row represents a record, and each column represents a field of that record. The header is the row at the top of the table that displays the names of these columns.

example; SELECT first_name, last_name, email FROM employees;

What are variables?

A variable is a container or a name that refers to a value stored in the computer's memory. It acts as a container for data that can be changed or used later in your program. Variables are essential for storing, and manipulating information during the execution of a program.

example; my_name = "XYZ"

Forming the Query (Request):

  1. When you want information from an API, you send a query. This is typically done by calling a URL (like a web address), which contains the instructions for the API on what you want.
  2. The query usually includes: Endpoint: This is the URL you send the request to. It's like the "address" of a specific feature or data you want from the API. Parameters: These are extra details you send with your request to specify exactly what you want. For example, if you're asking for user data, you might add a parameter like user_id=123 to get information for user 123.
Previous
Documents
Next
Spaces