File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -343,8 +343,19 @@ func (c *Catalog) RegisterFunction(ctx *sql.Context, fns ...sql.Function) {
343
343
}
344
344
}
345
345
346
+ // ExternalFunctionProvider is a function provider that may be set by an integrator for cases that the DatabaseProvider
347
+ // does not implement the necessary function provider logic (and we need more than the built-in functions). This is used
348
+ // by Catalog to check for functions if it is non-nil.
349
+ var ExternalFunctionProvider sql.FunctionProvider
350
+
346
351
// Function returns the function with the name given, or false if it doesn't exist.
347
352
func (c * Catalog ) Function (ctx * sql.Context , name string ) (sql.Function , bool ) {
353
+ if ExternalFunctionProvider != nil {
354
+ f , ok := ExternalFunctionProvider .Function (ctx , name )
355
+ if ok {
356
+ return f , true
357
+ }
358
+ }
348
359
if fp , ok := c .DbProvider .(sql.FunctionProvider ); ok {
349
360
f , ok := fp .Function (ctx , name )
350
361
if ok {
You can’t perform that action at this time.
0 commit comments