I’m trying to create many data sources. (and user groups, and users) to properly separate data visibility.
I’d like to do this programmatically .
(so that each user, has their own data_source that logs into the db with a different user.)
i see there is some CLI in the repo, but can’t find documentation for it,
also i am fine with doing this with queries directly,
but so far i’m stuck on encrypted options.
what is it expecting?
(from the code it looks like a jsonified dictionary, but that doesn’t work. )
here’s what i tried – the long line is the problematic one.
insert into data_sources ( encrypted_options, queue_name, created_at, id, name, scheduled_queue_name, org_id, type) VALUES( '{"dbname": "dbname__", "host": "xyz__", "password": "ppp", "port": 5432, "user": "userAA___"}', 'queries', current_timestamp, 6, 'test1', 'scheduled_queries',1, 'pg' )
all the other “encrypted options” start with the same prefix eg (modified:) "34767676767… ‘’
but whatever i try to insert any jsonifies dict, it has a different prefix in the data_sources
table eg. “42342…”,
and the GUI doesn’t render the data_sources until i delete the latest attempt.
Has anyone ever inserted data sources programatically?