WindmillWWindmill
Powered by
mitzjukimM
Windmill•12mo ago•
4 replies
mitzjukim

postgresql dynamic params

when running a postgres type script (which i understand is rust under the hood)
I am unable to utilize dynamic params when running.

sample script:
-- $1 name1 = 1 hours
SELECT user_id
FROM replica_views.player_view
WHERE user_id IS NOT NULL
AND created_at >= NOW() - INTERVAL "$1::TEXT";

it does work when it's like INTERVAL '1 hours';
also tried it without casting any type. and when moving quotes to input instead of code
also when using single quotes it just returns a null value.

this is the error.
ExecutionErr: error during execution of the script:
Error: db error: ERROR: syntax error at or near "$1": ERROR: syntax error at or near "$1" @handle_child.rs:528:16

should I open a bug, or is it a user error?
WindmillJoin
3,362Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?
Recent Announcements
henri-c

Weekly kenote to tell you about our latest updates https://discord.com/channels/930051556043276338/1278977038430240813 https://youtube.com/live/2dGd9TdT8xs?feature=share

henri-c · 4d ago

Pyra

### HTTP tracing (EE) Capture HTTP requests made by job scripts as observability spans Features: - View HTTP request traces (method, URL, status, timing) in the job details UI - Auto-instrumentation for Native TypeScript, MITM proxy for other languages - Integrates with external OpenTelemetry collectors changelog: https://www.windmill.dev/changelog/http-tracing docs: https://www.windmill.dev/docs/advanced/instance_settings#http-tracing Additionally jobs memory metrics are now fully OSS!

Pyra · 2w ago

henri-c

First keynote of the year here https://discord.com/channels/930051556043276338/1278977038430240813 🙂

henri-c · 4w ago

Similar Threads

Including query params
TylerTTyler / help
7mo ago
HTTP Routes: Query Params
kroccKkrocc / help
10mo ago
Postgresql job crashing native worker
cytadela8Ccytadela8 / help
3y ago
Query params as input args
cmptrCcmptr / help
2y ago