Skip to content
Merged
Show file tree
Hide file tree
Changes from 43 commits
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

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
130 changes: 10 additions & 120 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ biome_js_syntax = "0.5.7"
biome_rowan = "0.5.7"
biome_string_case = "0.5.8"
bpaf = { version = "0.9.15", features = ["derive"] }
criterion = "0.5"
crossbeam = "0.8.4"
enumflags2 = "0.7.11"
ignore = "0.4.23"
Expand Down
2 changes: 1 addition & 1 deletion crates/pgt_completions/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ sqlx.workspace = true
tokio = { version = "1.41.1", features = ["full"] }

[dev-dependencies]
criterion = "0.5.1"
criterion.workspace = true
pgt_test_utils.workspace = true

[lib]
Expand Down
4 changes: 2 additions & 2 deletions crates/pgt_statement_splitter/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ pgt_text_size.workspace = true
regex.workspace = true

[dev-dependencies]
criterion = "0.3"
ntest = "0.9.3"
criterion.workspace = true
ntest = "0.9.3"

[[bench]]
harness = false
Expand Down
7 changes: 7 additions & 0 deletions crates/pgt_typecheck/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,28 @@ version = "0.0.0"
[dependencies]
globset = "0.4.16"
itertools = { version = "0.14.0" }
once_cell = "1.20.2"
pgt_console.workspace = true
pgt_diagnostics.workspace = true
pgt_query.workspace = true
pgt_schema_cache.workspace = true
pgt_text_size.workspace = true
pgt_treesitter.workspace = true
pgt_treesitter_grammar.workspace = true
regex = "1.11.1"
sqlx.workspace = true
tokio.workspace = true
tree-sitter.workspace = true
uuid = { version = "1.18.1", features = ["v4"] }

[dev-dependencies]
criterion.workspace = true
insta.workspace = true
pgt_test_utils.workspace = true

[[bench]]
harness = false
name = "error_rewriting"

[lib]
doctest = false
55 changes: 55 additions & 0 deletions crates/pgt_typecheck/benches/error_rewriting.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
use criterion::{Criterion, black_box, criterion_group, criterion_main};
use pgt_typecheck::IdentifierReplacement;
use pgt_typecheck::diagnostics::rewrite_error_message;

fn benchmark_error_rewriting(c: &mut Criterion) {
let replacement = IdentifierReplacement {
original_name: "user_id".to_string(),
original_range: 0..7,
default_value: "'00000000-0000-0000-0000-000000000000'".to_string(),
type_name: "uuid".to_string(),
};

// test case 1: matching the first pattern (most common case)
c.bench_function("rewrite_invalid_input_syntax", |b| {
b.iter(|| {
rewrite_error_message(
black_box(r#"invalid input syntax for type integer: "00000000-0000-0000-0000-000000000000""#),
black_box(&replacement),
)
})
});

// test case 2: matching the operator pattern
c.bench_function("rewrite_operator_does_not_exist", |b| {
b.iter(|| {
rewrite_error_message(
black_box("operator does not exist: integer + text"),
black_box(&replacement),
)
})
});

// test case 3: no pattern matches (fallback)
c.bench_function("rewrite_fallback", |b| {
b.iter(|| {
rewrite_error_message(
black_box("some other error message that doesn't match any pattern"),
black_box(&replacement),
)
})
});

// test case 4: longer error message with first pattern
c.bench_function("rewrite_long_message", |b| {
b.iter(|| {
rewrite_error_message(
black_box(r#"invalid input syntax for type timestamp: "00000000-0000-0000-0000-000000000000" at character 45"#),
black_box(&replacement),
)
})
});
}

criterion_group!(benches, benchmark_error_rewriting);
criterion_main!(benches);
Loading