问题描述
jaeger-all-in-one with memory说:
很高兴看到一个例子。
解决方法
您首先应该通过:func.create
注册功能:
box.schema.func.create("function1.divide",{language = 'C',returns = 'number',is_deterministic = true,exports = {'LUA','SQL'}})
您可以在此处阅读有关主题的更多信息:https://www.tarantool.io/en/doc/latest/tutorials/c_tutorial/
然后您可以在SQL中使用它:
box.execute('SELECT "function1.divide"()')
您还可以查看源代码(test/box/function1.test.lua)中的更多示例。