Skip to content

DbDataSource and multiple hosts #4321

@roji

Description

@roji

Based on an offline discussion with @Brar yesterday, once we implement DbDataSource, we should give specific thought to what happens with multiple hosts.

  • We likely want a single DbDataSource to correspond to a MultiHostConnectorPool. The DbDataSource would then be registered in DI (or whatever), and it would be possible to get connections to the various multiple servers from it.
  • That likely means that the connection string for the DbDataSource won't need to contain a TargetSessionAttribute - only a host list. When actually requesting a connection from the DbDataSource, the user would pass in the TargetSessionAttributes at that point. This would be an Npgsql-specific overload to getting a connection.
  • We may even want an overload for creating a command directly against the DbDataSource (without a connection), which again accepts a TargetSessionAttributes (for usability but also for multiplexing + multiple hosts).

/cc @vonzshik @Brar

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions