🌐 AI搜索 & 代理 主页
Skip to content

Commit 74de286

Browse files
author
Nik Samokhvalov
committed
test(cli): fix limited role creation in integration test
- Avoid dynamic EXECUTE with nested quotes - Use exception handler for duplicate_object
1 parent 3254165 commit 74de286

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

cli/test/init.integration.test.cjs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,11 @@ test("integration: init reports nicely when lacking permissions", { skip: !haveP
256256
await c.connect();
257257
await c.query(`do $$ begin
258258
if not exists (select 1 from pg_roles where rolname='limited') then
259-
execute 'create role limited login password ${sqlLiteral(limitedPw)}';
259+
begin
260+
create role limited login password ${sqlLiteral(limitedPw)};
261+
exception when duplicate_object then
262+
null;
263+
end;
260264
end if;
261265
end $$;`);
262266
await c.query("grant connect on database testdb to limited");

0 commit comments

Comments
 (0)