raghav-reglobe opened a new pull request, #228:
URL: https://github.com/apache/doris-mcp-server/pull/228

   ## What
   
   Add an optional `init_command` to `DatabaseConfig` (global and token-bound), 
carry it in `DatabasePoolConfig` as a `NotRequired` key, and pass it to 
`aiomysql.create_pool` in `_create_pool_with_candidates`.
   
   ## Why
   
   Hosts that front Doris with a service account often need every pooled 
connection to start in a prepared session state: a session-narrowing switch, a 
`SET` of session variables, a workload-group pin. aiomysql's `init_command` is 
the right hook (it runs once per new connection), but the pool factory builds 
every pool without it. Today a host has to subclass `DorisConnectionManager` 
and re-implement pool creation just to add one statement, and then keep that 
subclass in lockstep with every refactor of the factory. On 0.6.1, where pool 
creation lived in six methods, such a subclass silently missed paths; 1.0.0 
collapsed the factory into one method, which makes a config field the durable 
seam.
   
   ## Behaviour
   
   - Unset (default): the key is omitted from the pool config, so existing pool 
configs stay byte-identical for equality-based callers and serialized configs.
   - Set on the global config: applies to the global pool; per-user pools 
inherit it.
   - Set on a token's `database_config`: applies to that token's pool.
   
   ## Tests
   
   `test/utils/test_pool_init_command.py`: global and token-bound paths pass 
the statement through, the default omits the key, an explicit pool config takes 
precedence. Existing pool tests unchanged.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to