Skip to content

Instantly share code, notes, and snippets.

@gszr
Created October 20, 2025 18:43
Show Gist options
  • Save gszr/d102e8cf50c0c92405ef6954dbfebcc0 to your computer and use it in GitHub Desktop.
Save gszr/d102e8cf50c0c92405ef6954dbfebcc0 to your computer and use it in GitHub Desktop.
require "luarocks.loader"
setmetatable(_G, nil)
local config = {
application_name = "kong",
host = "localhost",
port = 5432,
user = "kong",
password = nil,
database = "kong",
ssl = false,
}
local pgmoon = require "pgmoon"
local db = assert(pgmoon.new(config))
assert(db:connect())
local res, err = db:query("select * from services;") --> { { dog = "hello" } }
print(require"inspect"(res))
print(err)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment