File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed
Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -214,9 +214,8 @@ func WithAutoDeclare() QueryBindConnectorOption {
214214//
215215// connector, err := ydb.Connector(driver, ydb.WithCustomConverter(&MyCustomConverter{}))
216216func WithCustomConverter (converter bind.Converter ) QueryBindConnectorOption {
217- bind .RegisterConverter (converter )
218-
219- return xsql .WithQueryBind (bind.CustomConverter {})
217+ // Register the converter in a connector-scoped way by passing it as an option.
218+ return xsql .WithQueryBind (bind.CustomConverter {Converter : converter })
220219}
221220
222221// WithCustomNamedValueConverter registers a custom named value converter for database/sql query parameters
@@ -237,11 +236,9 @@ func WithCustomConverter(converter bind.Converter) QueryBindConnectorOption {
237236//
238237// connector, err := ydb.Connector(driver, ydb.WithCustomNamedValueConverter(&MyNamedConverter{}))
239238func WithCustomNamedValueConverter (converter bind.NamedValueConverter ) QueryBindConnectorOption {
240- bind .RegisterNamedValueConverter (converter )
241-
242- return xsql .WithQueryBind (bind.CustomNamedValueConverter {})
239+ // Instead of global registration, return a per-connector option carrying the converter.
240+ return xsql .WithQueryBind (bind.CustomNamedValueConverter {Converter : converter })
243241}
244-
245242func WithPositionalArgs () QueryBindConnectorOption {
246243 return xsql .WithQueryBind (bind.PositionalArgs {})
247244}
You can’t perform that action at this time.
0 commit comments