Skip to content

Commit

Permalink
Query parameters Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
delfrrr committed Jan 8, 2025
1 parent fda3da7 commit 8663105
Show file tree
Hide file tree
Showing 7 changed files with 115 additions and 7 deletions.
8 changes: 4 additions & 4 deletions config/_default/menus.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
url = "/docs/configuration/"

[[docs]]
name = "Dekart Cloud"
weight = 3
identifier = "cloud"
url = "/docs/cloud/"
name = "Usage"
weight = 2
identifier = "usage"
url = "/docs/usage/"

[[docs]]
name = "Snowpark"
Expand Down
4 changes: 1 addition & 3 deletions content/docs/cloud/cloud-security-faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ description: "Why Dekart Cloud is Secure"
date: 2021-02-22T07:48:05+01:00
lastmod: 2021-02-22T07:48:05+01:00
draft: false
menu:
docs:
parent: "cloud"
images: []
canonical: "/docs/usage/cloud-security-faq/"
---

<p class="lead text-left"><a href="/">Dekart Cloud</a> is designed to make your cybersecurity and legal teams happy. We achieve it by never storing tokens, and query results in Dekart Cloud backend.</p>
Expand Down
44 changes: 44 additions & 0 deletions content/docs/usage/cloud-security-faq.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
title: "Security Considerations"
description: "Why Dekart Cloud is Secure"
date: 2021-02-22T07:48:05+01:00
lastmod: 2021-02-22T07:48:05+01:00
draft: false
menu:
docs:
parent: "usage"
images: []
canonical: "/docs/usage/cloud-security-faq/"
---

<p class="lead text-left"><a href="/">Dekart Cloud</a> is designed to make your cybersecurity and legal teams happy. We achieve it by never storing tokens, and query results in Dekart Cloud backend.</p>

<!-- * **Passthrough Authentication**: Short-lived Google OAuth token is passed from your browser to Google APIs and never stored on Dekart Cloud backend.
* **No User Data Storage**: Query results are stored on Google Cloud Storage bucket provided by you.
* **Compliance Friendly**: We comply with [Google API Services User Data Policy](https://cloud.google.com/terms/services) and verified by Google's Trust & Safety team. -->

### What permissions am I granting to Dekart, and why are they necessary?

You are granting Dekart the following scopes:
* `https://www.googleapis.com/auth/bigquery` this scope grants Dekart the ability to manage user data in Google BigQuery, encompassing actions like running queries, managing datasets, and configuring settings.
* `https://www.googleapis.com/auth/devstorage.read_write` this scope allows Dekart to read and write user data in Google Cloud Storage, enabling it to manage files and potentially other data storage elements.

These permissions are necessary for Dekart to run queries and store results in your Google Cloud Storage bucket.

### How will my data be used and protected?

SQL queries and their results are stored in Google Cloud Storage bucket *provided by you!* We never store tokens, and query results in Dekart Cloud backend. Nobody at Dekart can access your BigQuery data or Google Cloud Storage bucket.

### Can I revoke Dekart's access if I change my mind?

Yes, you can revoke Dekart's access to your Google Cloud resources by signing out of Dekart Cloud. This will remove Dekart's access to your Google Cloud resources and prevent Dekart from running queries or storing results in your Google Cloud Storage bucket.

### Does Dekart comply with data protection regulations?

We are committed to upholding the principles of GDPR and ensuring that your data rights are respected. We also comply with [Google API Services User Data Policy](https://cloud.google.com/terms/services) and verified by Google's Trust & Safety team.

### What support is available if I have issues or questions about data access?

If you have any questions or issues about data access, please contact us via email at [[email protected]](mailto:[email protected]) or via [Slack](https://slack.dekart.xyz/).
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
66 changes: 66 additions & 0 deletions content/docs/usage/query-parameters/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
---
title: "Query Parameters"
description: "Turn your maps in applications with Dekart Query Parameters."
date: 2021-02-22T07:48:05+01:00
lastmod: 2021-02-22T07:48:05+01:00
draft: false
menu:
docs:
parent: "usage"
images: ["dekart-query-parameters.png", "setting-default-query-parameter-value.png", "share-with-query-params.png"]
---

<p><iframe width="560" height="315" src="https://www.youtube.com/embed/aItBYkfr530" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></p>

👉 [Example Map with Query Parameters](https://cloud.dekart.xyz/reports/322dbd27-0699-4c41-8a08-a3e023edf981/source?qp_country=DE&qp_region=BE&ref=query-param-example)

Query parameters in Dekart provide a powerful way to make your maps interactive and dynamic. With query parameters, you can create SQL queries that dynamically adjust based on user input. Below is a detailed guide to understanding and using query parameters in Dekart.

---

## Syntax for Query Parameters
Query parameters are wrapped in double curly braces (`{{parameter_name}}`) and can be used in your SQL queries. For example:
```sql
SELECT geometry
FROM `bigquery-public-data.overture_maps.division_area`
WHERE region = {{region}}
AND subtype = 'region'
```

In this query:
- `{{region}}` is a query parameter that the user can set dynamically.
- SQL logic adjusts based on the value provided for the parameter.

## Setting Default Values
You can define default values for query parameters. This is useful when a user doesn't provide input for a parameter.

{{< img src="setting-default-query-parameter-value.png" >}}


## Making Parameters Optional
To make a parameter optional:
1. Use SQL logic to handle cases where the parameter is not provided.
2. Combine conditions in your query to handle "all data" when a parameter is empty.

For instance:
Example:
```sql
SELECT geometry
FROM `bigquery-public-data.overture_maps.division_area`
WHERE (
({{region}} = 'ALL' AND country = 'FR')
OR region = 'FR-' || {{region}}
)
AND subtype = 'region'
```
- The default value `'ALL'` ensures that if no value is entered, all regions are shown.

## Sharing Reports with Query Parameters

{{< img src="share-with-query-params.png" >}}

When you share a report with query parameters, the parameters are included in the URL. This allows you to share a report with specific parameters set.

User with Editor and Admin roles, who have access to update the report, can change the query parameters and see the updated results.

Viewers can view only cached results with the parameters set by the report owner.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8663105

Please sign in to comment.