Created
April 23, 2018 13:48
-
-
Save r6m/c7f2d57d4678b8cb7ab1b7be6d697980 to your computer and use it in GitHub Desktop.
module
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
local function get_topic(context, payload) | |
local query = "SELECT * from game_topics WHERE id = $1" | |
local parameters = {payload.id} | |
local ok, rows = pcall(nk.sql_query, query, parameters) | |
if ok then | |
return { topic = rows[1] } | |
else | |
error(rows) | |
return { status = "error", error = rows} | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment