This component creates a UUID version 4 value, writes it to given database details (connection, schema name etc.) passing only this to one given column. The details are passed by workflow variables. The generated value is appended to the input variables and this is returned to the outside as flow variable and as single column, single row table, e.g. to be used as a session identifier.
Prerequisits:
A database that
- Implicitly converts the string passed to a UUID attribute into its internal format (e.g. PostgreSQL).
- supports schemas
Table in that rows can be inserted giving only the value of 'this' one column - intendedly its PK.
Parameters/Workflow variables:
- log_schema_name, string, denominates the schema the table resides in that will take over the uuid value
- processings_table_name, string, denominates the table into that the value is going to be inserted
- pk_column_name, string, denominates the column into that the value is going to be inserted
Improvement ideas:
- assemble the insert query before the executor such that none-schema databases are supported
-a workflow variable for the call of the Python uuid function such that more than version 4 of UUIDs are supported
Author: https://forum.knime.com/u/thiemo.kellner
© 2023 Thiemo Kellner
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see https://www.gnu.org/licenses/.
- Type: DB SessionPort 1Specifies the DB connection used to write the session to the database that
- implicitly converts the string passed to a UUID attribute into its internal format (e.g. PostgreSQL).
- supports schemas
- Type: Flow VariablePort 2Variables with the database specifics:
- log_schema_name, string, denominates the schema the table resides in that will take over the uuid value
- processings_table_name, string, denominates the table into that the value is going to be inserted
- pk_column_name, string, denominates the column into that the value is going to be inserted