Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style(daos): rename function parameter to keep consistency #14242

Merged
merged 1 commit into from
Feb 6, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions kong/db/dao/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ local function check_upsert(self, key, entity, options, name)
end


local function recursion_over_constraints(self, entity, show_ws_id, entries, c)
local function recursion_over_constraints(self, entity, opts, entries, c)
local constraints = c and c.schema:get_constraints()
or self.schema:get_constraints()

Expand All @@ -650,15 +650,15 @@ local function recursion_over_constraints(self, entity, show_ws_id, entries, c)
if constraint.on_delete == "cascade" then
local dao = self.db.daos[constraint.schema.name]
local method = "each_for_" .. constraint.field_name
for row, err in dao[method](dao, pk, nil, show_ws_id) do
for row, err in dao[method](dao, pk, nil, opts) do
if not row then
log(ERR, "[db] failed to traverse entities for cascade-delete: ", err)
break
end

insert(entries, { dao = dao, entity = row })

recursion_over_constraints(self, row, show_ws_id, entries, constraint)
recursion_over_constraints(self, row, opts, entries, constraint)
end
end
end
Expand All @@ -667,10 +667,10 @@ local function recursion_over_constraints(self, entity, show_ws_id, entries, c)
end


local function find_cascade_delete_entities(self, entity, show_ws_id)
local function find_cascade_delete_entities(self, entity, opts)
local entries = {}

recursion_over_constraints(self, entity, show_ws_id, entries)
recursion_over_constraints(self, entity, opts, entries)

return entries
end
Expand Down
Loading