Skip to content

Commit ee3bad7

Browse files
committed
Enhance SQLPage documentation for execution process and function handling
- Clarify the execution flow of SQL statements in SQLPage, detailing the decision-making process for handling statements. - Expand on the role of `sqlpage.*` functions and their execution context. - Improve explanations and examples to illustrate the differences between local handling and database execution. - Update section titles for better readability and understanding.
1 parent 034b848 commit ee3bad7

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

examples/official-site/extensions-to-sql.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
11
## How SQLPage runs your SQL
22

3-
SQLPage reads your SQL file and runs one statement at a time. For each statement, it decides whether to:
3+
SQLPage reads your SQL file and runs one statement at a time. For each statement, it
44

5-
- handle it inside SQLPage, or
6-
- send it to your database as a prepared statement.
5+
- decides whether to:
6+
- handle it inside SQLPage, or
7+
- prepare it as a (potentially slightly modified) sql statement on the database.
8+
- extracts values from the request to pass them as prepared statements parameters
9+
- runs [`sqlpage.*` functions](/functions)
10+
- passes the database results to components
711

8-
This page explains that boundary in simple, practical terms, with examples you can reuse.
12+
This page explains every step of the process,
13+
with examples and details about differences between how SQLPage understands SQL and how your database does.
914

1015
## What runs where
1116

12-
### Handled by SQLPage
17+
### Handled locally by SQLPage
1318

1419
- Static simple selects (a tiny, fast subset of SELECT)
1520
- Simple variable assignments that use only literals or variables
21+
- All sqlpage functions
1622

1723

1824
### Sent to your database
@@ -21,7 +27,7 @@ Everything else: joins, subqueries, arithmetic, database functions, `SELECT @@VE
2127

2228
### Mixed statements using `sqlpage.*` functions
2329

24-
[`sqlpage.*` functions](/functions.sql) are executed by SQLPage, not by your database. They can run:
30+
[`sqlpage.*` functions](/functions.sql) are executed by SQLPage; your database never sees them. They can run:
2531

2632
- Before the query, when used as values inside conditions or parameters.
2733
- After the query, when used as top-level selected columns (applied per row).

0 commit comments

Comments
 (0)