Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
c0ed76c
ok?
juleswritescode Sep 19, 2025
fd0d198
ok?
juleswritescode Sep 26, 2025
d4ece2e
testie testie
juleswritescode Sep 26, 2025
dae4b9a
ok so far
juleswritescode Sep 26, 2025
c35c596
Merge branch 'main' of https://github.com/supabase-community/postgres…
juleswritescode Sep 26, 2025
2823ca0
ack
juleswritescode Sep 26, 2025
a2ae8f0
OKJ
juleswritescode Sep 26, 2025
802a0d2
install em toolz
juleswritescode Sep 26, 2025
934a44b
oke then
juleswritescode Sep 26, 2025
e3b5e30
amazing!
juleswritescode Sep 27, 2025
79cb776
Merge branch 'main' of https://github.com/supabase-community/postgres…
juleswritescode Sep 27, 2025
b472454
remove unneeded
juleswritescode Sep 27, 2025
48ade40
better api
juleswritescode Sep 27, 2025
38741b4
almost there…
juleswritescode Sep 27, 2025
7e63009
ok?
juleswritescode Sep 27, 2025
4e0ef81
ack ack
juleswritescode Sep 27, 2025
5f1d273
comment
juleswritescode Sep 27, 2025
d503333
Update crates/pgt_text_size/src/text_range_replacement.rs
juleswritescode Sep 27, 2025
bb9bfba
ok
juleswritescode Sep 27, 2025
3eb2f61
simple
juleswritescode Sep 27, 2025
79109a0
Merge branch 'main' into feat/longer-type-replacements
juleswritescode Oct 3, 2025
52cd007
intermediary
juleswritescode Oct 3, 2025
00fe8ef
resolve conflicts
juleswritescode Oct 3, 2025
e669094
ok then…
juleswritescode Oct 3, 2025
0cf105e
its not dead
juleswritescode Oct 3, 2025
7c7549c
no more spaces
juleswritescode Oct 10, 2025
53e2429
ok
juleswritescode Oct 10, 2025
41405a6
we got em tests
juleswritescode Oct 10, 2025
8cfef05
Update crates/pgt_typecheck/tests/diagnostics.rs
juleswritescode Oct 10, 2025
f653ea5
Merge branch 'main' into feat/shorter-type-replacements
juleswritescode Oct 10, 2025
6ec8115
better
juleswritescode Oct 10, 2025
1ddbc5e
Merge branch 'feat/shorter-type-replacements' of https://github.com/s…
juleswritescode Oct 10, 2025
36345c6
ack
juleswritescode Oct 10, 2025
22b4e54
kewl
juleswritescode Oct 10, 2025
b2ec636
very good, very good
juleswritescode Oct 10, 2025
63e57d5
ok
juleswritescode Oct 10, 2025
a94f549
readied
juleswritescode Oct 10, 2025
4b7053d
ok
juleswritescode Oct 10, 2025
97c566a
fix tests
juleswritescode Oct 10, 2025
8af181b
fixie fixie messagie
juleswritescode Oct 10, 2025
d37bdc0
lockfile
juleswritescode Oct 10, 2025
b4d513b
accept snapshot
juleswritescode Oct 10, 2025
40e4c93
no tracing
juleswritescode Oct 10, 2025
caee75a
Merge branch 'main' into feat/improved-type-msgs
juleswritescode Oct 15, 2025
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
testie testie
  • Loading branch information
juleswritescode committed Sep 26, 2025
commit d4ece2ebd36fcf480a64e6f3748efd38eb900484
53 changes: 53 additions & 0 deletions crates/pgt_completions/src/providers/tables.rs
Original file line number Diff line number Diff line change
Expand Up @@ -656,4 +656,57 @@ mod tests {
)
.await;
}

#[sqlx::test(migrator = "pgt_test_utils::MIGRATIONS")]
async fn completes_tables_in_policies(pool: PgPool) {
let setup = r#"
create schema auth;

create table auth.users (
uid serial primary key,
name text not null,
email text unique not null
);

create table auth.posts (
pid serial primary key,
user_id int not null references auth.users(uid),
title text not null,
content text,
created_at timestamp default now()
);
"#;

pool.execute(setup).await.unwrap();

assert_complete_results(
format!(
r#"create policy "my cool pol" on {}"#,
QueryWithCursorPosition::cursor_marker()
)
.as_str(),
vec![
CompletionAssertion::LabelAndKind("public".into(), CompletionItemKind::Schema),
CompletionAssertion::LabelAndKind("auth".into(), CompletionItemKind::Schema),
],
None,
&pool,
)
.await;

assert_complete_results(
format!(
r#"create policy "my cool pol" on auth.{}"#,
QueryWithCursorPosition::cursor_marker()
)
.as_str(),
vec![
CompletionAssertion::LabelAndKind("posts".into(), CompletionItemKind::Table),
CompletionAssertion::LabelAndKind("users".into(), CompletionItemKind::Table),
],
None,
&pool,
)
.await;
}
}
5 changes: 2 additions & 3 deletions crates/pgt_completions/src/relevance/filtering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,10 @@ impl CompletionFilter<'_> {
WrappingClause::CreatePolicy
| WrappingClause::AlterPolicy
| WrappingClause::DropPolicy => {
ctx.before_cursor_matches_kind(&["keyword_on"])
ctx.matches_ancestor_history(&["object_reference"])
&& ctx.before_cursor_matches_kind(&["keyword_on", "."])
}

WrappingClause::AlterPolicy | WrappingClause::DropPolicy | WrappingClause::CreatePolicy => ctx.

_ => false,
},

Expand Down