Commit 43d262b
authored
chore(splinter): initial commit (#594)
adds a new `pgls_splinter` crate with the basic integration.
its not hooked up yet.
pr includes
- the query execution
- the transformation into splinter diagnostics
- a codegen tool for the diagnostics categories that extracts them from
the sql file
- a build file that downloads and parses the splinter.sql file from the
repo. its cached and committed. The build script is just a helper when
we want to "upgrade". we only have to change the SHA in build.rs for
that.
- a check that splinter is only executed if supabase roles are in the
target database
the query currently crashes when executed against a non-supabase
database because of the calls to `pg_catalog.has_table_privilege('anon',
c.oid, 'SELECT')` in some of the rules. for now, we skip splinter if the
roles are not there. I opened an issue to ask for permission to add a
flag to each rule so it can be used outside of supabase too:
supabase/splinter#135. I would rather not make
it our own just yet, but thats certainly a simple fix if things take too
long.
UPDATE: manually split up the query into supabase-only and generic rules
in a follow-up.
follow up prs will include:
- refactoring of the analyser codegen so we can reuse it for other lint
tools to generate config, docs etc
- integration of the new DatabaseLocation attribute of the diagnostics
struct (pr is open)1 parent 5533414 commit 43d262b
File tree
28 files changed
+2420
-129
lines changed- .github/workflows
- .sqlx
- crates
- pgls_completions/src/providers
- pgls_diagnostics_categories/src
- pgls_splinter
- src
- tests
- snapshots
- vendor
- pgls_test_utils/testdb_migrations
- packages
- @postgres-language-server/backend-jsonrpc/src
- @postgrestools/backend-jsonrpc/src
- xtask/codegen/src
28 files changed
+2420
-129
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
272 | 272 | | |
273 | 273 | | |
274 | 274 | | |
| 275 | + | |
| 276 | + | |
275 | 277 | | |
276 | 278 | | |
277 | 279 | | |
| |||
Lines changed: 74 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| 85 | + | |
85 | 86 | | |
86 | 87 | | |
87 | 88 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
49 | 69 | | |
50 | 70 | | |
51 | 71 | | |
52 | 72 | | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
| 73 | + | |
64 | 74 | | |
65 | 75 | | |
66 | 76 | | |
| |||
71 | 81 | | |
72 | 82 | | |
73 | 83 | | |
74 | | - | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
| 84 | + | |
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
| 97 | + | |
108 | 98 | | |
109 | 99 | | |
110 | 100 | | |
| |||
116 | 106 | | |
117 | 107 | | |
118 | 108 | | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
| 109 | + | |
130 | 110 | | |
131 | 111 | | |
132 | 112 | | |
| |||
140 | 120 | | |
141 | 121 | | |
142 | 122 | | |
143 | | - | |
| 123 | + | |
144 | 124 | | |
145 | 125 | | |
146 | 126 | | |
147 | 127 | | |
148 | 128 | | |
149 | 129 | | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | | - | |
155 | | - | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | | - | |
160 | | - | |
| 130 | + | |
161 | 131 | | |
162 | 132 | | |
163 | 133 | | |
| |||
171 | 141 | | |
172 | 142 | | |
173 | 143 | | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
| 144 | + | |
185 | 145 | | |
186 | 146 | | |
187 | 147 | | |
| |||
200 | 160 | | |
201 | 161 | | |
202 | 162 | | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
| 163 | + | |
215 | 164 | | |
216 | 165 | | |
217 | 166 | | |
| |||
225 | 174 | | |
226 | 175 | | |
227 | 176 | | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
238 | | - | |
239 | | - | |
| 177 | + | |
240 | 178 | | |
241 | 179 | | |
242 | 180 | | |
| |||
248 | 186 | | |
249 | 187 | | |
250 | 188 | | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
| 189 | + | |
263 | 190 | | |
264 | 191 | | |
265 | 192 | | |
| |||
298 | 225 | | |
299 | 226 | | |
300 | 227 | | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
| 228 | + | |
322 | 229 | | |
323 | 230 | | |
324 | 231 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
50 | 74 | | |
51 | 75 | | |
52 | 76 | | |
| |||
69 | 93 | | |
70 | 94 | | |
71 | 95 | | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
72 | 103 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
0 commit comments