shsql: create stream

SQL database system
| Manual page for CREATE(STREAM)

## CREATE STREAM

`CREATE STREAM` is a shsql SQL command extension that allows a shell command to appear to shsql as a temporary table.`` Whenever the temporary table is referenced in a `SELECT` statement, the shell command is executed.

Usage: `CREATE STREAM` temptablename `AS` shellcommand

temptable names the temporary table that will be created.

shellcommand is the shell command to be executed. It will be executed with the project data directory as its current working directory, at the time it is accessed in a `SELECT` command.`` The shellcommand must produce a data stream on its standard output that has a fieldname header and fields/records delimited appropriately.``

Security concern: Avoid building shellcommand with user-supplied values.`` If this must be done, care must be taken to process the user-supplied values first to remove shell meta characters, quote characters, semi-colons, etc.`` Otherwise malicious users may be able to execute arbitrary commands.``

Example: `CREATE STREAM $tmp1 AS compstats 65 gbvol M`
Copyright Steve Grubb

Markup created by unroff 1.0, `` `` June 02, 2005.