e07594579b
Replace the `StmtParam`/`ParameterExtractor` machinery with a shared `SqlPageExpr` type parameterized over its input source, distinguishing standalone expressions from per-row expressions via the type system. Rename `ParsedSqlFile` to `SqlFile` and split SQL parsing into dedicated `dialect`, `rewrite`, and `statement` submodules. Queries are now rewritten into either a database query with bindings and computed columns, or a single-row query evaluated without a database round trip. Make `SqlPageFunctionName` parsing case-insensitive and support SQLPage-computed projections and nested functions over query results.
10 lines
410 B
SQL
10 lines
410 B
SQL
select 'It%20works%20%21' as expected, sqlpage.url_encode(sqlpage.read_file_as_text('tests/it_works.txt')) as actual;
|
|
|
|
select 'It%20works%20%21' as expected,
|
|
sqlpage.url_encode(sqlpage.read_file_as_text(path)) as actual
|
|
from (select 'tests/it_works.txt' as path) paths;
|
|
|
|
select '%2Fvalue' as expected,
|
|
coalesce(sqlpage.url_encode('/' || value), '') as actual
|
|
from (select 'value' as value) value_rows;
|