A SQL request is a request against a SQL database. It's the runtime data resource form of SQL.
In a SQL request processing, Tabulify will:
Sql scripts can be stored in
SQL files will become SQL Request if they are represented in an runtime data uri
For instance:
(top-5-clients.sql@cd)@sqlite
where:
Sql scripts are generally stored in a SQL File but you can get them from any resource.
If the resource has:
Example:
(statements_view@sqlite)@sqlite
((select_statement.sql@cd)@sqlite)@sqlite
(statements.csv@cd)@sqlite
Tabulify supports all SQL Statements:
Example of kind manifest
kind: sql-request
spec:
data-uri: (script.sql@cd)@database
data-def:
parameters:
- value: value1
direction: IN
type: varchar
- value: value2
direction: OUT
type: integer
- ...
strict-execution: true
where:
Tabulify is based on resource chaining (ie one resource, one response). Therefore, a SQL Request should return only one result set.
It means that in a SQL Request, you:
If you want to execute a SQL Request with this limitation, you need to split the statements before running them in a pipeline
Note that not all database supports returning multiple result set. For instance, SQL Server does not support it.
When executing a query, the database engine may return warnings.
A warning may come from:
Tabulify sends this warnings to the standard error stream so that:
When creating this runtime, we needed to give it a name.
We went through the following names in order:
They were not selected:
Finally, we ended up with request because: