Skip to content

Commit aaa8e7b

Browse files
committed
add faq
1 parent d3b5fa9 commit aaa8e7b

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# FAQs
2+
3+
## How do you deal with SQL injection attacks?
4+
5+
Because VulcanSQL supports multiple connectors (e.g.: Snowflake, BigQuery, etc.), so we delegate our connectors to handle the SQL injection
6+
by their prepared statement through parameterized queries from the connectors' client:
7+
8+
BigQuery: https://cloud.google.com/bigquery/docs/parameterized-queries
9+
```sql
10+
SELECT word, word_count FROM `bigquery-public-data.samples.shakespeare`
11+
WHERE corpus = @corpus AND word_count >= @min_word_count
12+
ORDER BY word_count DESC
13+
```
14+
15+
Snowflake: https://docs.snowflake.com/en/developer-guide/node-js/nodejs-driver-execute#binding-statement-parameters
16+
```sql
17+
SELECT word, word_count FROM `bigquery-public-data.samples.shakespeare`
18+
WHERE corpus = :1 AND word_count >= :2
19+
ORDER BY word_count DESC
20+
```
21+
22+
Then, we replace the input parameters with parameterized values like $1, $2 ...etc, and record the input values in the
23+
`Parameterizer` when sending a query from an API request with query arguments. Finally we organize the SQL statement with
24+
parameters query in the `DataQueryBuilder` and send it to the connector to delegate the connector client to handle SQL
25+
injection and execute the SQL query.
26+
27+
You could see https://github.com/Canner/vulcan-sql/pull/40 to read it more.

packages/doc/sidebars.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,10 @@ const sidebars = {
431431
type: 'doc',
432432
id: 'references/data-source-profile',
433433
},
434+
{
435+
type: 'doc',
436+
id: 'references/faq',
437+
},
434438
{
435439
type: 'html',
436440
value: '<br/><br/>',

0 commit comments

Comments
 (0)