lua-resty-query

convenient wrapper for pgmoon

$ opm get xiangnanscu/lua-resty-query

lua-resty-query

convenient wrapper for pgmoon

Requirements

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',
      POOL_SIZE = 50,
    }
    -- 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