Commit bd9c821
fix: handle large INSERT INTO statements in PostgreSQL parser
Fixes parsing errors for large structure.sql files with extensive INSERT INTO schema_migrations blocks.
Changes:
- Filter out schema_migrations INSERT statements before parsing (not needed for ERD generation)
- Improve incomplete statement detection to avoid false "syntax error at end of input" errors
- Increase chunk size growth limit from 2x to 10x to handle larger statements
Resolves #4000
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent 3f10237 commit bd9c821
File tree
2 files changed
+50
-13
lines changed- frontend/packages/schema/src/parser/sql/postgresql
2 files changed
+50
-13
lines changedLines changed: 34 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
13 | 30 | | |
14 | 31 | | |
15 | 32 | | |
| |||
80 | 97 | | |
81 | 98 | | |
82 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
83 | 115 | | |
84 | 116 | | |
85 | 117 | | |
| |||
136 | 168 | | |
137 | 169 | | |
138 | 170 | | |
| 171 | + | |
139 | 172 | | |
140 | 173 | | |
141 | 174 | | |
142 | 175 | | |
143 | 176 | | |
144 | | - | |
| 177 | + | |
145 | 178 | | |
146 | 179 | | |
147 | 180 | | |
| |||
Lines changed: 16 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | | - | |
7 | 4 | | |
8 | 5 | | |
9 | 6 | | |
10 | 7 | | |
11 | 8 | | |
12 | 9 | | |
13 | 10 | | |
| 11 | + | |
| 12 | + | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
| |||
197 | 196 | | |
198 | 197 | | |
199 | 198 | | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
| 199 | + | |
| 200 | + | |
204 | 201 | | |
205 | | - | |
| 202 | + | |
206 | 203 | | |
207 | 204 | | |
208 | 205 | | |
209 | 206 | | |
210 | 207 | | |
211 | 208 | | |
212 | 209 | | |
213 | | - | |
214 | | - | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
215 | 219 | | |
216 | | - | |
| 220 | + | |
217 | 221 | | |
218 | 222 | | |
219 | 223 | | |
| |||
222 | 226 | | |
223 | 227 | | |
224 | 228 | | |
225 | | - | |
| 229 | + | |
226 | 230 | | |
227 | 231 | | |
228 | 232 | | |
| |||
0 commit comments