Closed rfay closed 1 year ago
@lolautruche so in
relationships:
database: "mysqldb:mysql"
cache: "memcached:memcached"
the right-hand side of mysqldb:mysql
or memcached:memcached
is meaningless right? So all we care about, for example, with the database
line here in .platform.app.yaml is the join value (mysqldb
, which joins to the services .yaml stanza) and the right-hand side mysql
is meaningless?
Oh,
# The left-hand side is the name of the relationship as it will be exposed
# to the application in the PLATFORM_RELATIONSHIPS variable. The right-hand
# side is in the form `<service name>:<endpoint name>`.
But I guess I don't know what <endpoint name>
means, can you enlighten me?
Oh, the problem in this issue is not this, I don't think.
It's that I didn't remember that mysql:10.2
actually means mariadb:10.2
.
@rfay The doc states the following:
The endpoint_name is the exposed functionality of the service to use. For most services, the endpoint is the same as the service type. For some services (such as MariaDB and Solr), you can define additional explicit endpoints for multiple databases and cores in the service’s configuration.
So it's only relevant to a few services like MariaDB, which can define several endpoints (multiple databases).
Ah, so "endpoint" means "name of database" then? So we probably need to not use the endpoint name often given here (in this example "mysql") and instead use (by default) the name of ddev's default database, "db", when creating PLATFORM_RELATIONSHIPS? Or of course, add logic which will create databases of the endpoint/database name provided. That's probably the most robust thing in the end. Perhaps a post-start hook could create the databases.
It actually means more "name of the server".
If it means "name of the server" then where would the name of the database be? Or is server name == db name in Platformsh-land?
You would define this in the services.yaml
(see the configuration for MariaDB/MySQL), on at the relationship level. By default, the DB name is main
and referred as path
in the $PLATFORM_RELATIONSHIPS
JSON.
Testing out blog.blackfire.io I see that
config.platformsh.yaml
ends up withwhich is obviously impossible, so the mapping here isn't being done right. .platform.app.yaml has
and services.yaml has
That should work. In relationships lines, the left part of the pair (mysqldb) in this case is free form and should be joined to the item of the same name in services.yaml