Open tmds opened 4 years ago
What does your tye.yaml look like for this? I think adding that extension method makes sense, however I think we'll need to require people to specify the protocol rather than trying to infer it from the connection string, ex:
- name: postgres
image: postgres
bindings:
- port: 5555
connectionString: <connectionstring>
protocol: postgres
The CONNECTIONSTRING__ convention predates Tye. I don't think we would want to remove that from the system as it fits nicely with how people do it today without them needing to change. Adding the others as well though is also possible.
Do you have some specific way of using this in mind?
I think we'll need to require people to specify the protocol rather than trying to infer it from the connection string
Agree. Infering is not needed. And protocol is not mandatory.
Do you have some specific way of using this in mind?
Pick the proper EF Core provider based on GetServiceProtocol(...)
.
Service discovery for databases doesn't include the type of database (e.g. mssql, PostgreSQL, ...)
Proposal
The service discovery for databases can also use the
SERVICE__
prefix.This means
CONNECTIONSTRING__USERS
becomesSERVICE__USERS__CONNECTIONSTRING
.The
__PROTOCOL
suffix can then be used to indicate the type of database: e.g.:SERVICE__USERS__PROTOCOL=postgresql
.An extension method can be added on
IConfiguration
toGetServiceProtocol
.cc @rynowak @jkotalik @davidfowl