...
To write to a database you can use conn:execute{}
. This allows you to execute any ad hoc SQL statement on a database, including UPDATE and INSERT statements. Can also call Stored stored procedures (link).
By default, SQL statements specified in calls to conn:execute{}
are not executed while you are editing the script. They are only executed when the channel is being run. This behavior can be overridden by setting the live parameter to true, in which case the statements are executed every time the script is executed in the editor. Be cautious about using live=true
since the script is executed many times to get the annotation and auto-completion data (which can cause many INSERTs and UPDATEs) .
...