Skip to content

Commit 93f13de

Browse files
committed
progress
1 parent c6e6395 commit 93f13de

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed
Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1-
-- expect_only_lint/safety/preferJsonb
2-
-- select 1;
1+
-- expect_lint/safety/preferJsonb
2+
CREATE TABLE users (
3+
id integer,
4+
data json
5+
);
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
source: crates/pgt_analyser/tests/rules_tests.rs
3+
expression: snapshot
4+
snapshot_kind: text
5+
---
6+
# Input
7+
```
8+
-- expect_lint/safety/preferJsonb
9+
CREATE TABLE users (
10+
id integer,
11+
data json
12+
);
13+
14+
```
15+
16+
# Diagnostics
17+
lint/safety/preferJsonb ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
18+
19+
× Prefer JSONB over JSON for better performance and functionality.
20+
21+
i JSON stores exact text representation while JSONB stores parsed binary format. JSONB is faster for queries, supports indexing, and removes duplicate keys.
22+
23+
i Consider using JSONB instead unless you specifically need to preserve formatting or duplicate keys.

0 commit comments

Comments
 (0)