Documentation
¶
Overview ¶
Program cloud-db-compare creates a database + user on each of a CCS's MariaDB and MySQL stacks, prints a side-by-side comparison of the responses, and tears down.
How "which database server" is chosen ¶
A SiteHost Cloud Container Server (CCS) can run multiple database engines simultaneously, each as its own Docker stack. The stack names ARE the engine identifiers — typical examples:
mariadb1108 — MariaDB 11.8 mysql57 — MySQL 5.7 mysql8 — MySQL 8.x postgres15 — PostgreSQL 15
(See cloud.stack.image.list_all for the catalog of available engines + the exact stack code shapes.)
When creating a database via cloud.db.Add, the `mysql_host` field selects which DB stack on the CCS the database lives in. It is NOT a hostname in the DNS sense — it's the stack name that's resolvable inside the CCS Docker network.
This example discovers what DB stacks are present on the target CCS by listing stacks and matching well-known prefixes (mariadb*, mysql*, postgres*). For each match it provisions a throwaway database, then prints what each engine returned so you can see how the platform reports them differently.
Required env ¶
SH_API_KEY — API key
SH_CLIENT_ID — client id
SH_CCS_NAME — name of the Cloud Container Server with the
database stacks deployed
Optional env ¶
SH_CONTAINER_NAME — existing www-type container name on the
CCS to use as the database's owning
container (cloud.db.Add's `container`
field). If unset, the example picks the
first non-DB / non-infra stack it finds on
the CCS. Provide explicitly if your CCS
has multiple containers and you want to
pin the association.
JOURNEY_KEEP=1 — leave the created databases + users in place
(default: cleanup).