Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: passing database schema with env variable #323

Open
pavlovdog opened this issue Nov 5, 2024 · 5 comments
Open

Feature request: passing database schema with env variable #323

pavlovdog opened this issue Nov 5, 2024 · 5 comments
Labels

Comments

@pavlovdog
Copy link

Running envio is awesome, but it becomes a little tricky when having >1 instance. In my case, I would love to have many indexers running with the same database. Now, it will result in many clashes, because of the same table names (chains_metadata, etc), so I use many databases like envio-db-1, envio-db-2, ...

The easiest way to avoid this would be to pass the schema name as an environment variable, like ENVIO_PG_SCHEMA. So different indexers will use different schemas and avoid clashes.

@JonoPrest
Copy link
Collaborator

We are looking to support env variables in config.yaml soon! Some discussion on #315

@JonoPrest
Copy link
Collaborator

Sorry I think I misunderstood you. This does sound like a powerful feature 🤔

@pavlovdog
Copy link
Author

pavlovdog commented Nov 19, 2024

Thank @JonoPrest for your quick response! Yep, and I think it also can be a "short path" solution for other problems.

For instance, imagine a user needs to run many identical indexers within different processes but the same database (in my case, it's one instance per chain). As I understand it's not possible now (or at least not recommended). But adding a unique schema per process solves the issue! Additionally, adding a view allows me to encapsulate all the nuances.

I think it's indeed quite a powerful feature!

@DZakh DZakh self-assigned this Nov 19, 2024
@DZakh
Copy link
Member

DZakh commented Nov 21, 2024

Am I right that you'd like to be able to change public to something else?

@DZakh DZakh removed their assignment Nov 21, 2024
@pavlovdog
Copy link
Author

@DZakh yep

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants