GetReadOnlyDB
Uses the dbConfig to create a sqlx DB object for the read replica passed via the config.
def GetReadOnlyDB(
ctx: context.Context,
dbConfig: *DbConfig
) - > *sqlx.DB, error
Uses the dbConfig to create a sqlx DB object for the read replica passed via the config.
Parameters
| Name | Type | Description |
|---|---|---|
| ctx | context.Context | The context for the database operation, used for cancellation and timeouts. |
| dbConfig | *DbConfig | The database configuration containing connection details, including the read replica host. This parameter cannot be nil. |
Returns
| Type | Description |
|---|---|
*sqlx.DB, error | A sqlx DB object configured for the read replica, or an error if initialization fails. |