Skip to content

Commit

Permalink
fix strategies/postgres.lua
Browse files Browse the repository at this point in the history
  • Loading branch information
chronolaw committed Oct 12, 2024
1 parent b72014d commit 0cf0ac4
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions kong/clustering/services/sync/strategies/postgres.lua
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,13 @@ local NEW_VERSION_QUERY = [[
-- { type = "route", "id" = "0a5bac5c-b795-4981-95d2-919ba3390b7e", "ws_id" = "73478cf6-964f-412d-b1c4-8ac88d9e85e9", row = "JSON", }
-- }
function _M:insert_delta(deltas)
local escape_literal = self.connector:escape_literal

local buf = buffer.new()
for _, d in ipairs(deltas) do
buf:putf("(new_version, %s, %s, %s, %s)",
escape_literal(d.type),
escape_literal(d.id),
escape_literal(d.ws_id),
escape_literal(cjson_encode(d.row)))
self.connector:escape_literal(d.type),
self.connector:escape_literal(d.id),
self.connector:escape_literal(d.ws_id),
self.connector:escape_literal(cjson_encode(d.row)))
end

local sql = string_format(NEW_VERSION_QUERY, buf:get())
Expand Down

0 comments on commit 0cf0ac4

Please sign in to comment.