You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*[Upsert Row By Primary Key)](#upsert-row-by-primary-key)
20
+
*[Known Limitations](#known-limitations)
21
+
22
+
Execute stored procedure
23
+
24
+
## General information
25
+
### Description
4
26
This is an open source component for working with object-relational database management systems on [elastic.io platform](http://www.elastic.io"elastic.io platform").
With this component you will have following triggers:
13
-
14
-
``SELECT`` - this trigger will execute an [SQL](https://en.wikipedia.org/wiki/SQL"SQL") query that returns multiple results, it has limitations on the query and suited only for SELECT type of queries. The trigger will remember last execution timestamp and let you build queries on it.
15
-
16
-
``GET ROWS POLLING`` - this trigger will execute select query from specified table with simple criteria of selected datetime or timestamp table. The trigger will remember last execution timestamp and let you build queries on it.
17
-
18
-
Following actions are inside:
19
-
20
-
``SELECT`` - this action will execute an [SQL](https://en.wikipedia.org/wiki/SQL"SQL") query that returns multiple results, it has limitations on the query and suited only for SELECT type of queries.
21
-
22
-
``LOOKUP BY PRIMARY KEY`` - this action will execute select query from specified table, as criteria can be used only [PRIMARY KEY](https://en.wikipedia.org/wiki/Primary_key"PRIMARY KEY"). The action returns only one result (a primary key is unique).
23
-
24
-
``UPSERT BY PRIMARY KEY`` - this action will execute select command from specified table, as search criteria can be used only [PRIMARY KEY](https://en.wikipedia.org/wiki/Primary_key"PRIMARY KEY"), and execute insert command by PRIMARY KEY with specified field, if result does not found, else - action will execute update command by PRIMARY KEY with specified field. The action returns only one result row (a primary key is unique).
25
-
26
-
``DELETE BY PRIMARY KEY`` - this action will execute delete query from specified table, as criteria can be used only [PRIMARY KEY](https://en.wikipedia.org/wiki/Primary_key"PRIMARY KEY"). The action returns an integer value that indicates the number of rows affected, the returned value can be 0 or 1 (a primary key is unique).
27
-
28
-
``INSERT`` - this action will execute insert query into the specified table. The action returns boolean value is execution insert successful or not.
29
-
30
-
### How works
31
-
32
-
### Requirements
33
-
Before you can deploy any code into elastic.io **you must be a registered elastic.io platform user**. Please see our home page at [http://www.elastic.io](http://www.elastic.io) to learn how.
34
-
35
-
#### Environment variables
36
-
For integration-testing is needed to specify following environment variables:
37
-
1. Connection to MSSQL:
38
-
-``CONN_USER_MSSQL`` - user login
39
-
-``CONN_PASSWORD_MSSQL`` - user password
40
-
-``CONN_DBNAME_MSSQL`` - DataBase name
41
-
-``CONN_HOST_MSSQL`` - DataBase host
42
-
-``CONN_PORT_MSSQL`` - DataBase port
43
-
2. Connection to MySQL:
44
-
-``CONN_USER_MYSQL`` - user login
45
-
-``CONN_PASSWORD_MYSQL`` - user password
46
-
-``CONN_DBNAME_MYSQL`` - DataBase name
47
-
-``CONN_HOST_MYSQL`` - DataBase host
48
-
-``CONN_PORT_MYSQL`` - DataBase port
49
-
3. Connection to Oracle:
50
-
-``CONN_USER_ORACLE`` - user login
51
-
-``CONN_PASSWORD_ORACLE`` - user password
52
-
-``CONN_DBNAME_ORACLE`` - DataBase name
53
-
-``CONN_HOST_ORACLE`` - DataBase host
54
-
-``CONN_PORT_ORACLE`` - DataBase port
55
-
4. Connection to PostgreSQL:
56
-
-``CONN_USER_POSTGRESQL`` - user login
57
-
-``CONN_PASSWORD_POSTGRESQL`` - user password
58
-
-``CONN_DBNAME_POSTGRESQL`` - DataBase name
59
-
-``CONN_HOST_POSTGRESQL`` - DataBase host
60
-
-``CONN_PORT_POSTGRESQL`` - DataBase port
61
-
#### Others
62
33
## Credentials
63
34
You need to use following properties to configure credentials:
64
35
65
-
### DB Engine
66
-
Choose one of existing database types:
36
+
```DB Engine``` - Choose one of existing database types:
Optional field. Provide port of the server instance, as by default:
39
+
```Connection URI``` - Provide hostname of the server, e.g. ``acme.com``
40
+
41
+
```Connection port``` - Optional field. Provide port of the server instance, as by default:
73
42
-``3306`` - MySQL
74
43
-``5432`` - PostgreSQL
75
44
-``1521`` - Oracle
76
45
-``1433`` - MSSQL
77
-
### Database Name
78
-
Provide name of database at the instance that you want to interact with.
79
-
### User
80
-
Provide a username that has permissions to interact with the Database.
81
-
### Password
82
-
Provide a password of the user that has permissions to interact with the Database.
83
-
### Configuration properties
84
-
Optional field. Provide a configuration properties for connections to the Database, e.g. ``useUnicode=true&serverTimezone=UTC``
46
+
47
+
```Database Name``` - Provide name of database at the instance that you want to interact with.
48
+
49
+
```User``` - Provide a username that has permissions to interact with the Database.
50
+
51
+
```Password``` - Provide a password of the user that has permissions to interact with the Database.
52
+
53
+
```Configuration properties``` - Optional field. Provide a configuration properties for connections to the Database, e.g. ``useUnicode=true&serverTimezone=UTC``
85
54
86
55
**Limitation:**`Configuration properties` value may not be checked during Credentials Verifacation, so in case of using this field make sure that it contains correct input.
87
56
@@ -100,6 +69,7 @@ The format of ``Start Polling From (optional)`` field should be like ``yyyy-mm-d
100
69
-``mi`` - minute
101
70
-``ss`` - second
102
71
-``sss`` - millisecond (optional)
72
+
-
103
73
### Get Rows Polling trigger
104
74
This trigger can polling data from provided table. As WHERE clause you can use column, which has datatype like DATE or TIMESTAMP.
The action will execute an [SQL](https://en.wikipedia.org/wiki/SQL"SQL") query that can return multiple results, it has limitations on the query and suited only for SELECT type of queries.
173
144
In SQL query you can use clause variables with specific data types.
174
145
Internally we use prepared statements, so all incoming data is
@@ -201,9 +172,14 @@ Following types are supported:
Checkbox ``Don't throw Error on an Empty Result`` allows to emit an empty response, otherwise you will get an error on empty response.
177
+
Dropdown **Emit Behaviour** contains following possible options:
178
+
* Fetch all - a single message with an array `results` containing all the objects (rows) will be emitted
179
+
* Emit Individually - multiple messages (one message per one row) will be emitted
180
+
* Expect Single - a single message with one result row will be emitted. If more than one row is returned the error will be thrown. A boolean input "Allow Zero Results" (defaults to `false`) appears at input metadata. If `false` - error will be thrown, else - the empty object will be emitted.
Component supports dynamic incoming metadata - as soon as your query is in place it will be parsed and incoming metadata will be generated accordingly.
@@ -241,7 +217,7 @@ As output metadata, you will get execution insert result like:
The action will execute delete query from a ``Table`` dropdown field, as criteria can be used only [PRIMARY KEY](https://en.wikipedia.org/wiki/Primary_key"PRIMARY KEY"). The action returns count of affected rows.
247
223
Checkbox ``Don't throw Error on an Empty Result`` allows to emit an empty response, otherwise you will get an error on empty response.
@@ -290,7 +266,7 @@ Component generates next metadata:
The action will execute ``SELECT`` command from a ``Tables`` dropdown field, as search criteria can be used only [PRIMARY KEY](https://en.wikipedia.org/wiki/Primary_key"PRIMARY KEY"), and execute ``INSERT`` command by PRIMARY KEY with specified field, if result does not found, else - action will execute ``UPDATE`` command by PRIMARY KEY with specified field. The action returns only one result row (a primary key is unique).
295
271
1. Find and select jdbc-component in the component repository
This action exists in JDBC component only for backward compatibility.
333
-
Please use [**Upsert row by primary key**](#upsert-row-by-primary-key-action) instead.
309
+
Please use [**Upsert row by primary key**](#upsert-row-by-primary-key) instead.
310
+
311
+
### Select (Deprecated)
312
+
This action exists in JDBC component only for backward compatibility.
313
+
Please use [**Select action**](#select-action) instead.
334
314
335
-
## Current limitations
315
+
## Known limitations
336
316
1. Only tables with one [PRIMARY KEY](https://en.wikipedia.org/wiki/Primary_key"PRIMARY KEY") is supported. You will see the message ``Table has not Primary Key. Should be one Primary Key
337
317
``, if the selected table doesn't have a primary key. Also, you will see the message ``Composite Primary Key is not supported
338
318
``, if the selected table has composite primary key.
0 commit comments