lua-resty-query
pgmoon 的便捷包装器
$ opm get xiangnanscu/lua-resty-query
lua-resty-query
pgmoon 的便捷包装器
安装
opm get xiangnanscu/lua-resty-query
要求
lua-resty-dotenv (可选)
概述
local Query = require"resty.query"
-- config your database and get a query function
local query = Query {
HOST = 'localhost',
PORT = 5432,
USER = 'postgres',
PASSWORD = 'XXXXXX',
DATABASE = 'test',
CONNECT_TIMEOUT = 10000, -- 10 seconds
MAX_IDLE_TIMEOUT = 10000,-- 10 seconds
POOL = nil,
POOL_SIZE = 50,
SSL = false,
SSL_VERIFY = nil,
SSL_REQUIRED = nil,
DEBUG = true,
}
-- now use this function in your controllers
local res, err = query('select * from usr')
if res == nil then
return err
end
作者
Nan Xiang(@xiangnanscu)
许可证
mit
依赖
版本
-
pgmoon 的便捷包装器 2024-06-21 03:49:15
-
pgmoon 的便捷包装器 2024-05-03 03:08:09
-
pgmoon 的便捷包装器 2024-02-19 02:05:10
-
pgmoon 的便捷包装器 2024-01-25 01:23:55
-
pgmoon 的便捷包装器 2024-01-25 01:21:57
-
lua-resty-mysql 和 pgmoon 的便捷包装器 2018-03-18 11:38:34
-
lua-resty-mysql 或 pgmoon 的便捷包装器 2018-03-18 07:24:34