Data Resource - Runtime Data Resource

Undraw Environment

Data Resource - Runtime Data Resource

About

A runtime data resource is a special type of data resource that represents:

They are called runtime data resources because these data resources are created at and by the execution.

Example

(create.sql@cd)@sqlite
(script.sh@cd)@tmp

Type

Execution Locality Description List
Remote request Request/Response to a service SQL Request - database request
HTTP request - web server request
Local Operating System Command Script command - Textual computer language file
Binary command - Language Interpreter, Compiled Machine code instructions

Data Uri

Default Execution

A executable is represented with the following data uri

(executablePath@executableConnection)@executionConnection

where:

  • executablePath@executableConnection is the data uri of the executable resource. ie:
    • the resource containing the code
    • or an executable binary
  • executionConnection is the connection where the execution resource is executed.

Nested Execution

We even support deep nested execution resource when the execution of an executable returns a another executable.

((executableResourcePath@executionResourceConnection)@executionResourceConnection)@executionConnection

For instance:

((archive/world-sql--archive-entry.yml@howto)@tmp)@mysql
((select_statement.sql@cd)@sqlite)@postgres

Runtime Data Selectors

Runtime resources can be selected with a executable selector.

Execution

runtime resources are automatically executed at access/runtime.

For instance:

  • a sql select would be automatically executed and would return a result set.
  • a script would be automatically executed and return its standard output (as default)

Every operation will execute them when accessing them

ie:

  • If you print it 2 times, you will execute it 2 times.
  • If you print and copy it, you will execute it 2 times.

Example of execution:

tabul data print '(select.sql@cd)@sqlite'
# The quotes are mandatory in bash because parenthesis are a bash token (ie subshell)
tabul data copy '(create_dml.sql@cd)@sqlite'  result.log@tmp
# The quotes are mandatory in bash because parenthesis are a bash token (ie subshell)

Execute Operation

With the execute operation, you can perform execution in batch and get back the exit status.

Example: To execute:

you would execute this tabul data execute command

tabul data execute '(query*.sql@cd)@sqlite'
# The quotes are mandatory in bash because parenthesis are a bash token (ie subshell)

Attributes

Logical Name

The default logical name is the logical name of the execution resource.

Executable

The executable is the file found in the first part of the runtime data uri.

For instance, in this runtime data uri

(query.sql@cd)@sqlite

the executable is: query.sql@cd

query.sql@cd defines:

as executable

FAQ

Does a runtime resource exists

Runtime created from Exists
A data uri the executable exists
Dynamically with a pipeline operation true



Related HowTo
Undraw Environment
How to create a SQL view with a CREATE statement file

This Howto will show you how to create a SQL View with a SQL file that contains a CREATE SQL statement with the Tabul table create command. You should have Tabulify installed on your computer: ...
Undraw Environment
How to define an archive entry as data resource?

This howto will show you how to define an entry in an archive as data resource. In the world-db.tar.gz archive of the MySQL...
Undraw Environment
How to execute a bash script ?

This howto shows you how to execute a bash script against the local file system. The bash script that will be executed is: a simple hello world sample application that accepts optionally 1 argument...
Undraw Environment
How to execute a procedure in MySQL ?

This howto shows you how to create and execute a SQL Procedure in MySQL. This example has been taken from the official...
Undraw Environment
How to execute a procedure in Postgres?

This howto shows you how to create and execute a SQL Procedure in Postgres. This example has been taken from the official...
Undraw Environment
How to execute a procedure with an OUT parameter in Postgres?

This howto shows you how to create and execute a SQL Procedure with parameters in Postgres. This example has been taken from the official...
Undraw Environment
How to install the World MySQL Sample Schema

This howto will show you how to install the world sample schema of MySQL. The installation is done with the sql script world.sql This script is idempotent...
Undraw Environment
How to return a result set from a stored function in Postgres?

This howto shows you how to return a result set from a SQL function in Postgres. You can therefore create dynamically a SQL Query statement This example has been adapted from the official...
Undraw Environment
Learning Tabulify - Step 7 - How to execute a SQL Query

For Tabulify, a SQL Query is a runtime resource that when executed returns a data set in tabular format (known as the result set). The selector of a runtime is known as a runtime selector. This selector...
Undraw Environment
SQL - How to execute SQL DDL statements (CREATE, ALTER, ..)?

This howto will show you how to execute a SQL DDL query that contains multiple: DDL statements (ie CREATE, ALTER) and an DML (INSERT) The file containing this query is located below the howto...

Task Runner