Closed ghost closed 7 years ago
Look at the documentation:
Even though the module system is absent in pllua, PL/Lua allows for modules to be automatically loaded after creating the environment: all entries in table pllua.init are require'd at startup.
@golgote
Thank you for telling me.
The pllua extension installs both trusted and untrusted flavors of PL/Lua and creates the module table pllua.init. Alternatively, a systemwide installation though the PL template facility can be achieved with:
INSERT INTO pg_catalog.pg_pltemplate
VALUES ('pllua', true, 'pllua_call_handler', 'pllua_validator', '$libdir/pllua', NULL);
I'm sorry. I can not understand.
Specifically, if lua-requests is in this PATH(/usr/local/share/lua/5.1/requests.lua), how will it be available?
Best regards.
Try: INSERT INTO pllua.init ('module') VALUES ('requests');
This will require the module and make it available for all your scripts.
You might also want to use plluau (untrusted: less secure) instead of pllua (more secure) if you need require specifically, because it gives you access to everything in Lua.
@golgote
Thank you for telling me!! I understand .
this issue is close.
luajit pllua use.
example
sample function
use.
execute result.
pathcheck
result
How do I require the luarocks module?