lua-resty-query
convenient wrapper for pgmoon
$ opm get xiangnanscu/lua-resty-query
lua-resty-query
convenient wrapper for pgmoon
install
opm get xiangnanscu/lua-resty-query
Requirements
lua-resty-dotenv (optional)
Synopsis
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
Authors
Nan Xiang(@xiangnanscu)
License
mit
Dependencies
Versions
-
convenient wrapper for pgmoon 2024-06-21 03:49:15
-
convenient wrapper for pgmoon 2024-05-03 03:08:09
-
convenient wrapper for pgmoon 2024-02-19 02:05:10
-
convenient wrapper for pgmoon 2024-01-25 01:23:55
-
convenient wrapper for pgmoon 2024-01-25 01:21:57
-
convenient wrapper for lua-resty-mysql and pgmoon 2018-03-18 11:38:34
-
convenient wrapper for lua-resty-mysql or pgmoon 2018-03-18 07:24:34