This functionality is already provided by HHH-12589, so you can register SQL functions via the MetadataBuilderContributor.