Skip to content

Commit

Permalink
schema:extract_pk_values
Browse files Browse the repository at this point in the history
  • Loading branch information
chronolaw committed Oct 28, 2024
1 parent ddb8853 commit 9f7e924
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion kong/clustering/services/sync/hooks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,16 @@ end


function _M:entity_delta_writer(row, name, options, ws_id, is_delete)
-- composite key, like { id = ... }
local schema = kong.db[name].schema
local pk = schema:extract_pk_values(row)

assert(schema:validate_primary_key(pk))

local deltas = {
{
type = name,
pk = { id = row.id },
pk = pk,
ws_id = ws_id,
row = is_delete and ngx_null or row,
},
Expand Down

0 comments on commit 9f7e924

Please sign in to comment.