The SQL Parameter
The sql parameter lets you filter, sort, aggregate, and transform your data using SQL queries — directly in the URL. The query runs against your data after it's fetched from the source, using SQLite
How It Works
CSV Getter fetches your full dataset from Airtable/Notion/CSV.
The data is loaded into an in-memory SQLite database as a table called
csvgetter.Your SQL query runs against that table.
The filtered/transformed result is returned.
Important: The table name is always
csvgetter. Use this in yourFROMclause.
Basic Syntax
?sql=SELECT * FROM csvgetterURL-encoded:
?sql=SELECT%20*%20FROM%20csvgetterTip: The URL Wizard in the dashboard builds and encodes URLs for you automatically.
Examples
1. Select All Data
SELECT * FROM csvgetter2. Select Specific Columns
3. Filter with WHERE
4. Multiple Conditions (AND / OR)
5. Comparison Operators
6. LIKE (Pattern Matching)
7. IN (Multiple Values)
8. ORDER BY (Sorting)
9. LIMIT (Row Count)
10. LIMIT with OFFSET (Pagination)
This skips the first 20 rows and returns the next 10.
11. COUNT (Aggregation)
Sample output (as JSON):
12. SUM, AVG, MIN, MAX
13. GROUP BY
14. GROUP BY with HAVING
15. DISTINCT
16. NULL Handling
17. String Functions
18. CASE Expressions
19. Column Aliases
Column Names with Spaces
If your column names contain spaces, wrap them in double quotes:
Combining SQL with Other Parameters
The sql parameter works alongside other URL parameters:
Processing order:
Data is fetched from the source
sqlquery is appliedtypeformatting is appliedSide effects (
email_me,save_to_gdrive, etc.) execute
Error Handling
If your SQL is invalid, you'll get a 400 response:
Common errors:
no such column: X
Column name doesn't exist
Check your field names in the endpoint config
no such table: X
Wrong table name
Always use FROM csvgetter
near "X": syntax error
SQL syntax error
Check your SQL syntax
unrecognized token
Special characters not handled
Use URL encoding
Supported SQL Features (SQLite)
Since the SQL engine uses SQLite, you have access to:
SELECT,FROM,WHERE,ORDER BY,GROUP BY,HAVING,LIMIT,OFFSETAggregate functions:
COUNT,SUM,AVG,MIN,MAXString functions:
UPPER,LOWER,LENGTH,SUBSTR,TRIM,REPLACELIKE,IN,BETWEEN,IS NULL,IS NOT NULLCASE ... WHEN ... THEN ... ELSE ... ENDDISTINCTAND,OR,NOTComparison:
=,!=,<,>,<=,>=Math:
+,-,*,/,%,ABS,ROUND
Not supported:
JOIN(there's only one table)INSERT,UPDATE,DELETE(read-only)CREATE TABLE,ALTER TABLE,DROP(read-only)Subqueries (limited support — depends on complexity)
Last updated
Was this helpful?