rdesantis / hauldata

Database Process Automation made easy.
Apache License 2.0
1 stars 0 forks source link

Add return value to RUN PROCESS #133

Closed rdesantis closed 4 years ago

rdesantis commented 4 years ago

When invoked from the command line, the only supported return value type is Integer.

When invoked from another process, any return type is supported including TABLE.

Invocation syntax might be:

RUN PROCESS 'name' arg1 [, arg2 ... ] RETURNING variable

Within the process itself, there's no strong requirement that the return type be declared. I think it's good enough to just implement a "RETURN expression" task that terminates the process returning the evaluated expression.

rdesantis commented 4 years ago

Better than the above would be to make PROCESS a data source. Then you could do things like:

UPDATE var1, var1 FROM PROCESS 'name' arg1, arg2

...or...

FOR var1, var2 FROM PROCESS 'name' arg1, arg2

This would be an opportunity to genericize the RUN command to accept any data source that is capable of not returning a result, including an enhancement to the new EMAIL data source to make it capable of taking actions without returning a result.

rdesantis commented 4 years ago

Implemented per https://github.com/rdesantis/hauldata/commit/fd2ac233dbbb2844d6972943d35c05dbc2ab352c