2025-09-27 15:19:58 +08:00
|
|
|
---
|
|
|
|
|
--- Generated by EmmyLua(https://github.com/EmmyLua)
|
2025-10-15 17:05:35 +08:00
|
|
|
--- Created by .
|
2025-09-27 15:19:58 +08:00
|
|
|
--- DateTime: 2025/9/25 08:19
|
2025-10-14 14:45:47 +08:00
|
|
|
--- 业务逻辑
|
2025-10-15 17:05:35 +08:00
|
|
|
local cjson = require('cjson')
|
|
|
|
|
local pgmoon = require('pgmoon');
|
|
|
|
|
|
|
|
|
|
local _M = {}
|
2025-10-14 14:45:47 +08:00
|
|
|
|
|
|
|
|
-- 创建一个新的连接
|
|
|
|
|
local conn = pgmoon.new(db_config.postgres)
|
|
|
|
|
|
|
|
|
|
-- 连接到数据库
|
|
|
|
|
conn:connect(function(err)
|
|
|
|
|
if err then
|
|
|
|
|
print("Error connecting to database: ", err)
|
|
|
|
|
else
|
|
|
|
|
print("Connected to the PostgreSQL server.")
|
|
|
|
|
end
|
|
|
|
|
end)
|
2025-10-15 17:05:35 +08:00
|
|
|
|
|
|
|
|
function _M.getAllUser()
|
2025-10-15 17:22:04 +08:00
|
|
|
|
2025-10-15 17:05:35 +08:00
|
|
|
end
|
|
|
|
|
|
|
|
|
|
return _M
|