Replies: 1 comment
-
Hey @FatmanUK 👋 I think nobody asked for such a processor yet, so it wasn't added. Not sure why you're having a hard time using input:
generate:
mapping: |
root.id = count("generate")
root.foo = uuid_v4()
count: 3
interval: 0s
processors:
- log:
message: ${! content() }
- sql_raw:
driver: sqlite
dsn: file:./foobar.db
query: |
UPDATE TEST SET FOO = ? WHERE ID = ?
args_mapping: |
root = [
this.foo,
this.id
]
conn_max_idle: 1
conn_max_open: 1
init_statement: |
CREATE TABLE IF NOT EXISTS TEST (ID int, FOO varchar);
INSERT INTO TEST(ID, FOO) VALUES(1, 'foo'), (2, 'bar'), (3, 'baz');
output:
drop: {} Note that I'm setting After running that config, if I open the DB file using
instead of this:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm using Benthos in streams mode to decouple my database back-end from my basic webapp front-end. I can simulate a sql_update using a sql_raw DELETE and a sql_insert, but a sql_update instead would be handy. I can't figure out how to do the update using sql_raw.
Benthos is pretty cool. Well done devs! :)
Beta Was this translation helpful? Give feedback.
All reactions