Closed davemaier closed 10 months ago
Hi @davemaier, there's no such thing as stupid questions ;)
I think due to the fact that a postgres migration must be created on tables in order to subscribe, it won't be possible. Unless you don't mind dynamically running a migration in the database.
Could you describe a bit more about what you had in mind and the use case?
That's nice to hear, thanks. :)
I'm trying to build a service that runs as a docker container and can be utilized by a CLI (that uses a REST API for communication). Via the CLI it should be possible to configure the database to connect to, as well as webhooks that should be called when changes happen on the database. This is quite similar to #6, but I want it to run as a service that can be run in the cloud without the need for rebuild/redeployment on config changes.
I don't fully understand your answer. As far as I could see, walex doesn't do any changes or migrations to the db but uses the subscriptions array only for filtering in here.
@davemaier that makes sense.
The current config-based setup does have limitations and I'm open to changing it. How durable does the configuration need to be? Would it be okay if you lost the configuration whenever the service was re-deployed / restarted? If so, we could store the config in memory (via Elixir/Erlang ETS or similar) and have it configurable by http call. Or - set up a store for the config like Postgres (which means you'd also need to run a Postgres instance). Would that be okay?
Hi @davemaier
You can now dynamically update the config at runtime (via Elixir console, for example):
WalEx.Configs.add_config(:test_name, :subscriptions, ["new_subscriptions_1", "new_subscriptions_2"])
WalEx.Configs.remove_config(:test_name, :subscriptions, "new_subscriptions_2")
WalEx.Configs.replace_config(:test_name, :password, "new_password")
Of course, this will go away if the server restarts or is redeployed.
https://github.com/cpursley/walex/commit/71eaba2c88e278cb7d180741a0afe362e11552b2
Hi! Sorry for being slow, I'm quite time constrained atm. Just trying to wrap my head around how config works in elixir and how this behaves if multiple nodes are spawned. I'll try this. Thanks for the effort you've put in.
Hi! Thanks for the great library. I already got a very small example app running and it's working really well.
I'd like to build an http interface for this, so I can pack it into a docker container. The api should allow to change the list of tables that walex is subscribed to and ultimately it should also allow to change the db url while the docker container is running.
Is there any possibility this could work?
I'm quite new to elixir, so sorry if my question is dumb.