Dear OpenFN community,
I have two issues with the postgresql adapter in a self hosted OpenFn application in a dockerized environment.
- The idea is to send a POST request with some .json formatted data and store whatever was in the input .json as an entry in a postgres sql table called “payload” using this command:
// Get started by adding operations from the API reference
fn( state => {
insert('payload', {data: state.data }, {writeSql: true, setNull: "'NaN'", logValues: true });
return state;
});
I get a notification that the job succeeded, no error in the console of the docker but the “payload” table is still empty. However the table “dataclips” shows the data as expected which should come directly from the OpenFN application.
- Further it does not seem to matter if I provide a API token or not in the request using postman and executes the job in both matters.
Log on the docker indicates it ran through
cmd:
openfn execute \
-a @openfn/language-postgresql@latest=/app/priv/openfn/lib/node_modules/@openfn/language-postgresql-4.1.7 \
-s /tmp/state-1694596536-1-1mwmiwk.json \
--no-strict-output \
-l info \
-o /tmp/output-1694596536-1-v66c91.json \
/tmp/expression-1694596536-1-1f7rpcu.js
[debug]
f5070 : [CLI] ℹ Versions:
f5070 : ▸ node.js 18.17.1
f5070 : ▸ cli 0.0.35
f5070 : ▸ runtime 0.0.21
f5070 : ▸ compiler 0.0.29
f5070 : ▸ @openfn/language-postgresql 4.1.7
f5070 : [CLI] ✔ Loaded state from /tmp/state-1694596536-1-1mwmiwk.json
f5070 : [CLI] ℹ Added import statement for @openfn/language-postgresql
f5070 : [CLI] ℹ Added export * statement for @openfn/language-postgresql
f5070 : [CLI] ✔ Compiled job from /tmp/expression-1694596536-1-1f7rpcu.js
f5070 : [R/T] ℹ Resolved adaptor @openfn/language-postgresql to version 4.1.7
f5070 : [R/T] ✔ Operation 1 complete in 0ms
f5070 : [CLI] ✔ Writing output to /tmp/output-1694596536-1-v66c91.json
f5070 : [CLI] ✔ Done in 632ms! ✨
f5070 :
[debug] QUERY OK db=0.4ms idle=970.8ms
begin []
[debug] QUERY OK db=0.6ms