Skip to content

Commit 8df34ae

Browse files
committed
fix: address review comments on tutorial
- Fix frontmatter tags to use allowed values (Data API, Connector, SQL++ (N1QL), FTS, REST API) and stay within the 6-tag limit - Remove 0.0.0.0/0 suggestion from Capella setup, add security note guiding users to find their actual IP instead - Add parameterized query example ($country) in Step 3 demonstrating safe SQL++ parameter binding via the args field - Remove parameterized queries from "Next Steps" since now covered - Pin Docker images to specific versions (couchbase:7.6.2, tooljet/tooljet-ce:v3.16.0-LTS) for tutorial reproducibility
1 parent 61accd9 commit 8df34ae

1 file changed

Lines changed: 34 additions & 9 deletions

File tree

tutorial/markdown/connectors/tooljet/tooljet-couchbase-airline-dashboard.md

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,11 @@ technology:
1515
- query
1616
- fts
1717
tags:
18-
- ToolJet
19-
- Low-Code
2018
- Data API
2119
- Connector
22-
- Internal Tools
23-
- SQL++
24-
- Full-Text Search
20+
- SQL++ (N1QL)
21+
- FTS
22+
- REST API
2523
sdk_language:
2624
- nodejs
2725
length: 30 Mins
@@ -74,7 +72,8 @@ Couchbase Capella is the easiest way to get started. It has a free tier and the
7472
- Note down the **username** and **password**
7573
4. **Allow network access**:
7674
- Go to **Allowed IP Addresses**
77-
- Add the IP address of your ToolJet instance (or `0.0.0.0/0` for testing)
75+
- Add the IP address of your ToolJet instance (visit [whatismyip.com](https://whatismyip.com) to find your public IP if self-hosting)
76+
> **Security Note**: Never allow `0.0.0.0/0` (all IPs). Always restrict access to specific IP addresses, even in development.
7877
5. **Find your Data API endpoint**:
7978
- Go to **Connect** tab
8079
- Look for the **Data API** endpoint URL — it will look like `https://<cluster-id>.data.cloud.couchbase.com`
@@ -94,7 +93,7 @@ docker run -d --name couchbase-server \
9493
-p 8091-8096:8091-8096 \
9594
-p 11210-11211:11210-11211 \
9695
-p 18091-18096:18091-18096 \
97-
couchbase:latest
96+
couchbase:7.6.2
9897
```
9998

10099
2. **Initialize the cluster**:
@@ -131,7 +130,7 @@ docker run -d --name couchbase-server \
131130
docker run -d \
132131
--name tooljet \
133132
-p 80:80 \
134-
tooljet/tooljet-ce:latest
133+
tooljet/tooljet-ce:v3.16.0-LTS
135134
```
136135

137136
Open `http://localhost` and create your admin account.
@@ -215,6 +214,33 @@ You should see results in the preview panel — a list of airlines with their na
215214

216215
> **How it works**: This SQL++ query runs against the `airline` collection inside the `inventory` scope of the `travel-sample` bucket. `META().id` gives us the document ID, which we'll need for CRUD operations later.
217216
217+
### Using Parameterized Queries
218+
219+
Now let's create a second query that uses **parameterized arguments** — this is the recommended way to pass dynamic values in SQL++ because it prevents injection attacks.
220+
221+
1. Create another query named `listAirlinesByCountry`
222+
2. Configure it:
223+
- **Operation**: **Query**
224+
- **SQL++ Query**:
225+
226+
```sql
227+
SELECT META().id AS doc_id, name, country, callsign, iata, icao
228+
FROM `travel-sample`.`inventory`.`airline`
229+
WHERE country = $country
230+
ORDER BY name
231+
LIMIT 50
232+
```
233+
234+
- **Arguments (Key-Value)**:
235+
236+
```json
237+
{ "$country": "United States" }
238+
```
239+
240+
3. Click **Run** — you should see only airlines from the United States
241+
242+
> **Why parameterized queries?** Instead of concatenating user input directly into SQL++ strings (which risks injection attacks), Couchbase's `$parameter` syntax sends values separately from the query statement. The plugin passes these through the `args` field in the Data API request body. You can also pass **Query Options** like `{ "readonly": true, "timeout": "30s" }` for additional control.
243+
218244
## Step 4: Display Airlines in a Table
219245

220246
1. From the **Components** panel (right sidebar), drag a **Table** component onto the canvas
@@ -443,7 +469,6 @@ You've built a complete Airline Dashboard that demonstrates all 6 Couchbase oper
443469
### Next Steps
444470

445471
- **Add vector search**: Replace the FTS match query with a vector search query for semantic/AI-powered search
446-
- **Add parameterized queries**: Use `$parameter` syntax in SQL++ for advanced filtering
447472
- **Build more apps**: Customer support tools, inventory managers, reporting dashboards — all on your Couchbase data
448473
- **Explore ToolJet components**: Charts, maps, JSON viewers, and 50+ other widgets can visualize your Couchbase data in different ways
449474

0 commit comments

Comments
 (0)