docker-builds icon indicating copy to clipboard operation
docker-builds copied to clipboard

[Feature Request] add mysql visibility db independent init params

Open zengzilu opened this issue 3 years ago • 0 comments

Is your feature request related to a problem? Please describe.

in my case, databases are managed by a central team, they can't offer db "temporal" and "temporal_visibility" with same dbUrl, userName and password for some reason, it cause problem because the "auto-setup.sh" init db "temporal" and "temporal_visibility" with same env keys. "MYSQL_SEEDS", "MYSQL_USER", "MYSQL_PWD".

Describe the solution you'd like

I notice that when temporal-server generate config file, it has separate 2 db params to different env keys in config_template.yaml with "VISIBILITY_MYSQL_XXX", my solution is to add sub codes to auto-setup.sh

: "${VISIBILITY_MYSQL_SEEDS:=${MYSQL_SEEDS}}"
: "${VISIBILITY_MYSQL_USER:=${MYSQL_USER}}"
: "${VISIBILITY_MYSQL_PWD:=${MYSQL_PWD}}"

...

if [[ ${SKIP_DB_CREATE} != true ]]; then
    temporal-sql-tool --ep "${VISIBILITY_MYSQL_SEEDS}" -u "${VISIBILITY_MYSQL_USER}" -p "${DB_PORT}" "${MYSQL_CONNECT_ATTR[@]}" --db "${VISIBILITY_MYSQL_PWD}" create
fi
temporal-sql-tool --ep "${VISIBILITY_MYSQL_SEEDS}" -u "${VISIBILITY_MYSQL_USER}" -p "${DB_PORT}" "${MYSQL_CONNECT_ATTR[@]}" --db "${VISIBILITY_MYSQL_PWD}" setup-schema -v 0.0
temporal-sql-tool --ep "${VISIBILITY_MYSQL_SEEDS}" -u "${VISIBILITY_MYSQL_USER}" -p "${DB_PORT}" "${MYSQL_CONNECT_ATTR[@]}" --db "${VISIBILITY_MYSQL_PWD}" update-schema -d "${VISIBILITY_SCHEMA_DIR}"


Additional context

I'd like to submit a pr to fix it, may I join the repo

zengzilu avatar Feb 10 '23 09:02 zengzilu