Skip to content

Commit

Permalink
export GLOBAL_WORKSPACE_TAG
Browse files Browse the repository at this point in the history
  • Loading branch information
chobits committed Dec 18, 2024
1 parent fff7b02 commit 2e9a2ff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions kong/db/declarative/import.lua
Original file line number Diff line number Diff line change
Expand Up @@ -616,4 +616,6 @@ return {
load_into_cache_with_events = load_into_cache_with_events,
insert_entity_for_txn = insert_entity_for_txn,
delete_entity_for_txn = delete_entity_for_txn,

GLOBAL_WORKSPACE_TAG = GLOBAL_WORKSPACE_TAG,
}
3 changes: 2 additions & 1 deletion kong/db/strategies/off/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ local item_key = declarative.item_key
local item_key_prefix = declarative.item_key_prefix
local workspace_id = declarative.workspace_id
local foreign_field_key_prefix = declarative.foreign_field_key_prefix
local GLOBAL_WORKSPACE_TAG = declarative.GLOBAL_WORKSPACE_TAG


local PROCESS_AUTO_FIELDS_OPTS = {
Expand Down Expand Up @@ -330,7 +331,7 @@ local function select(self, pk, options)
local pk = pk_string(schema, pk)

-- if no specific ws_id is provided, we need to search all workspace ids
if ws_id == "*" then
if ws_id == GLOBAL_WORKSPACE_TAG then
for workspace, err in kong.db.workspaces:each() do
if err then
return nil, err
Expand Down

0 comments on commit 2e9a2ff

Please sign in to comment.