• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stephenafamo / bob / 14939098091

09 May 2025 10:59PM UTC coverage: 36.868% (-4.6%) from 41.506%
14939098091

push

github

stephenafamo
Move reusable sqlite parser components to antlrhelpers package

0 of 758 new or added lines in 12 files covered. (0.0%)

547 existing lines in 8 files now uncovered.

6533 of 17720 relevant lines covered (36.87%)

212.48 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/gen/bobgen-sqlite/driver/parser/mods.go
1
package parser
2

3
import (
4
        "fmt"
5
        "strings"
6

7
        "github.com/stephenafamo/bob/internal"
8
        sqliteparser "github.com/stephenafamo/sqlparser/sqlite"
9
)
10

11
func (v *visitor) modWith_clause(ctx interface {
12
        With_clause() sqliteparser.IWith_clauseContext
13
}, sb *strings.Builder,
UNCOV
14
) {
×
UNCOV
15
        with := ctx.With_clause()
×
UNCOV
16
        if with == nil {
×
UNCOV
17
                return
×
UNCOV
18
        }
×
19

UNCOV
20
        if with.RECURSIVE_() != nil {
×
21
                sb.WriteString("q.SetRecursive(true)\n")
×
22
        }
×
UNCOV
23
        for _, cte := range with.AllCommon_table_expression() {
×
NEW
24
                v.StmtRules = append(v.StmtRules,
×
UNCOV
25
                        internal.RecordPoints(
×
UNCOV
26
                                cte.GetStart().GetStart(),
×
UNCOV
27
                                cte.GetStop().GetStop(),
×
UNCOV
28
                                func(start, end int) error {
×
UNCOV
29
                                        fmt.Fprintf(sb, "q.AppendCTE(o.expr(%d, %d))\n", start, end)
×
UNCOV
30
                                        return nil
×
UNCOV
31
                                },
×
32
                        )...,
33
                )
34
        }
35
}
36

UNCOV
37
func (v *visitor) modSelect_stmt(ctx sqliteparser.ISelect_stmtContext, sb *strings.Builder) [][]string {
×
UNCOV
38
        var imports [][]string
×
UNCOV
39

×
UNCOV
40
        v.modWith_clause(ctx, sb)
×
UNCOV
41

×
UNCOV
42
        {
×
UNCOV
43
                core := ctx.Select_core()
×
UNCOV
44

×
UNCOV
45
                if distinct := core.DISTINCT_(); distinct != nil {
×
46
                        sb.WriteString("q.Distinct = true\n")
×
47
                }
×
48

UNCOV
49
                allResults := core.AllResult_column()
×
UNCOV
50
                if len(allResults) > 0 {
×
NEW
51
                        v.StmtRules = append(v.StmtRules, internal.RecordPoints(
×
UNCOV
52
                                allResults[0].GetStart().GetStart(),
×
UNCOV
53
                                allResults[len(allResults)-1].GetStop().GetStop(),
×
UNCOV
54
                                func(start, end int) error {
×
UNCOV
55
                                        fmt.Fprintf(sb, "q.AppendSelect(o.expr(%d, %d))\n", start, end)
×
UNCOV
56
                                        return nil
×
UNCOV
57
                                },
×
58
                        )...)
59
                }
60

UNCOV
61
                if from := core.From_item(); from != nil {
×
NEW
62
                        v.StmtRules = append(v.StmtRules, internal.RecordPoints(
×
UNCOV
63
                                from.GetStart().GetStart(),
×
UNCOV
64
                                from.GetStop().GetStop(),
×
UNCOV
65
                                func(start, end int) error {
×
UNCOV
66
                                        fmt.Fprintf(sb, "q.SetTable(o.expr(%d, %d))\n", start, end)
×
UNCOV
67
                                        return nil
×
UNCOV
68
                                },
×
69
                        )...)
70
                }
71

UNCOV
72
                if where := core.Where_stmt(); where != nil {
×
NEW
73
                        v.StmtRules = append(v.StmtRules, internal.RecordPoints(
×
UNCOV
74
                                where.WHERE_().GetSymbol().GetStop()+1,
×
UNCOV
75
                                where.GetStop().GetStop(),
×
UNCOV
76
                                func(start, end int) error {
×
UNCOV
77
                                        fmt.Fprintf(sb, "q.AppendWhere(o.expr(%d, %d))\n", start, end)
×
UNCOV
78
                                        return nil
×
UNCOV
79
                                },
×
80
                        )...)
81
                }
82

UNCOV
83
                if groupBy := core.Group_by_stmt(); groupBy != nil {
×
NEW
84
                        v.StmtRules = append(v.StmtRules, internal.RecordPoints(
×
85
                                groupBy.GetStart().GetStart(),
×
86
                                groupBy.GetStop().GetStop(),
×
87
                                func(start, end int) error {
×
88
                                        fmt.Fprintf(sb, "q.AppendGroup(o.expr(%d, %d))\n", start, end)
×
89
                                        return nil
×
90
                                },
×
91
                        )...)
92
                }
93

UNCOV
94
                if having := core.GetHavingExpr(); having != nil {
×
NEW
95
                        v.StmtRules = append(v.StmtRules, internal.RecordPoints(
×
96
                                having.GetStart().GetStart(),
×
97
                                having.GetStop().GetStop(),
×
98
                                func(start, end int) error {
×
99
                                        fmt.Fprintf(sb, "q.AppendHaving(o.expr(%d, %d))\n", start, end)
×
100
                                        return nil
×
101
                                },
×
102
                        )...)
103
                }
104

UNCOV
105
                for _, window := range core.AllWindow_stmt() {
×
NEW
106
                        v.StmtRules = append(v.StmtRules, internal.RecordPoints(
×
107
                                window.GetStart().GetStart(),
×
108
                                window.GetStop().GetStop(),
×
109
                                func(start, end int) error {
×
110
                                        fmt.Fprintf(sb, "q.AppendWindow(o.expr(%d, %d))\n", start, end)
×
111
                                        return nil
×
112
                                },
×
113
                        )...)
114
                }
115
        }
116

UNCOV
117
        compounds := ctx.AllCompound_select()
×
UNCOV
118

×
UNCOV
119
        if len(compounds) > 0 {
×
120
                imports = append(imports, []string{"github.com/stephenafamo/bob/clause"})
×
121
        }
×
122

UNCOV
123
        for _, compound := range ctx.AllCompound_select() {
×
124
                strategy := strings.ToUpper(compound.Compound_operator().GetText())
×
125
                all := compound.Compound_operator().ALL_() != nil
×
126
                if all {
×
127
                        strategy = strategy[:len(strategy)-3]
×
128
                }
×
NEW
129
                v.StmtRules = append(v.StmtRules, internal.RecordPoints(
×
130
                        compound.Select_core().GetStart().GetStart(),
×
131
                        compound.Select_core().GetStop().GetStop(),
×
132
                        func(start, end int) error {
×
133
                                fmt.Fprintf(sb, `
×
134
                        q.AppendCombine(clause.Combine{
×
135
                            Strategy: "%s",
×
136
                            All: %t,
×
137
                            Query: bob.BaseQuery[bob.Expression]{
×
138
                                Expression: o.expr(%d, %d),
×
139
                                QueryType: bob.QueryTypeSelect,
×
140
                                Dialect: dialect.Dialect,
×
141
                            },
×
142
                        })
×
143
                    `, strategy, all, start, end)
×
144
                                return nil
×
145
                        },
×
146
                )...)
147
        }
148

UNCOV
149
        if order := ctx.Order_by_stmt(); order != nil {
×
NEW
150
                v.StmtRules = append(v.StmtRules, internal.RecordPoints(
×
UNCOV
151
                        order.BY_().GetSymbol().GetStop()+1,
×
UNCOV
152
                        order.GetStop().GetStop(),
×
UNCOV
153
                        func(start, end int) error {
×
UNCOV
154
                                fmt.Fprintf(sb, "q.AppendOrder(o.expr(%d, %d))\n", start, end)
×
UNCOV
155
                                return nil
×
UNCOV
156
                        },
×
157
                )...)
158
        }
159

UNCOV
160
        if limit := ctx.Limit_stmt(); limit != nil {
×
161
                if limit.COMMA() != nil {
×
NEW
162
                        v.Err = fmt.Errorf("LIMIT with comma is not supported")
×
163
                }
×
164

NEW
165
                v.StmtRules = append(v.StmtRules, internal.RecordPoints(
×
166
                        limit.GetFirstExpr().GetStart().GetStart(),
×
167
                        limit.GetFirstExpr().GetStop().GetStop(),
×
168
                        func(start, end int) error {
×
169
                                fmt.Fprintf(sb, "q.SetLimit(o.expr(%d, %d))\n", start, end)
×
170
                                return nil
×
171
                        },
×
172
                )...)
173

174
                if offset := limit.GetLastExpr(); offset != nil {
×
NEW
175
                        v.StmtRules = append(v.StmtRules, internal.RecordPoints(
×
176
                                offset.GetStart().GetStart(),
×
177
                                offset.GetStop().GetStop(),
×
178
                                func(start, end int) error {
×
179
                                        fmt.Fprintf(sb, "q.SetOffset(o.expr(%d, %d))\n", start, end)
×
180
                                        return nil
×
181
                                },
×
182
                        )...)
183
                }
184
        }
185

UNCOV
186
        return imports
×
187
}
188

189
func (v *visitor) modInsert_stmt(ctx sqliteparser.IInsert_stmtContext, sb *strings.Builder) {
×
190
        v.modWith_clause(ctx, sb)
×
191

×
192
        if ctx.INSERT_() == nil {
×
NEW
193
                v.Err = fmt.Errorf("REPLACE INTO is not supported. Use INSERT OR REPLACE INTO instead")
×
194
                return
×
195
        }
×
196

197
        if or := ctx.GetUpsert_action(); or != nil {
×
NEW
198
                v.StmtRules = append(v.StmtRules, internal.RecordPoints(
×
199
                        or.GetStart(), or.GetStop(),
×
200
                        func(start, end int) error {
×
201
                                fmt.Fprintf(sb, "q.SetOr(o.raw(%d, %d))\n", start, end)
×
202
                                return nil
×
203
                        },
×
204
                )...)
205
        }
206

207
        table := ctx.Table_name()
×
208
        v.quoteIdentifiable(table)
×
209

×
210
        tableStart := table.GetStart().GetStart()
×
211
        tableStop := table.GetStop().GetStop()
×
212

×
213
        if schema := ctx.Schema_name(); schema != nil {
×
214
                v.quoteIdentifiable(schema)
×
215
                tableStart = schema.GetStart().GetStart()
×
216
        }
×
217

NEW
218
        v.StmtRules = append(v.StmtRules, internal.RecordPoints(
×
219
                tableStart, tableStop,
×
220
                func(start, end int) error {
×
221
                        fmt.Fprintf(sb, "q.Table.Expression = o.raw(%d, %d)\n", start, end)
×
222
                        return nil
×
223
                },
×
224
        )...)
225

226
        if alias := ctx.Table_alias(); alias != nil {
×
227
                v.quoteIdentifiable(alias)
×
NEW
228
                v.StmtRules = append(v.StmtRules, internal.RecordPoints(
×
229
                        alias.GetStart().GetStart(),
×
230
                        alias.GetStop().GetStop(),
×
231
                        func(start, end int) error {
×
232
                                fmt.Fprintf(sb, "q.Table.Alias = %q\n", getName(alias))
×
233
                                return nil
×
234
                        },
×
235
                )...)
236
        }
237

238
        allColumns := ctx.AllColumn_name()
×
239
        if len(allColumns) > 0 {
×
240
                colNames := make([]string, len(allColumns))
×
241
                for i, col := range allColumns {
×
242
                        colNames[i] = getName(col)
×
243
                }
×
244
                fmt.Fprintf(sb, "q.Table.Columns = %#v\n", colNames)
×
245
        }
246

247
        if values := ctx.Values_clause(); values != nil {
×
248
                for _, value := range values.AllValue_row() {
×
NEW
249
                        v.StmtRules = append(v.StmtRules, internal.RecordPoints(
×
250
                                value.OPEN_PAR().GetSymbol().GetStart()+1,
×
251
                                value.CLOSE_PAR().GetSymbol().GetStop()-1,
×
252
                                func(start, end int) error {
×
253
                                        fmt.Fprintf(sb, "q.AppendValues(o.expr(%d, %d))\n", start, end)
×
254
                                        return nil
×
255
                                },
×
256
                        )...)
257
                }
258
        }
259

260
        if selectStmt := ctx.Select_stmt(); selectStmt != nil {
×
NEW
261
                v.StmtRules = append(v.StmtRules, internal.RecordPoints(
×
262
                        selectStmt.GetStart().GetStart(),
×
263
                        selectStmt.GetStop().GetStop(),
×
264
                        func(start, end int) error {
×
265
                                fmt.Fprintf(sb, `q.Query = bob.BaseQuery[bob.Expression]{
×
266
                                                Expression: o.expr(%d, %d),
×
267
                                                Dialect: dialect.Dialect,
×
268
                                                QueryType: bob.QueryTypeSelect,
×
269
                                                }
×
270
                                        `, start, end)
×
271
                                return nil
×
272
                        },
×
273
                )...)
274
        }
275

276
        if upsert := ctx.Upsert_clause(); upsert != nil {
×
NEW
277
                v.StmtRules = append(v.StmtRules, internal.RecordPoints(
×
278
                        upsert.GetStart().GetStart(),
×
279
                        upsert.GetStop().GetStop(),
×
280
                        func(start, end int) error {
×
281
                                fmt.Fprintf(sb, "q.SetConflict(o.expr(%d, %d))\n", start, end)
×
282
                                return nil
×
283
                        },
×
284
                )...)
285
        }
286

287
        if returning := ctx.Returning_clause(); returning != nil {
×
NEW
288
                v.StmtRules = append(v.StmtRules, internal.RecordPoints(
×
289
                        returning.RETURNING_().GetSymbol().GetStop()+1,
×
290
                        returning.GetStop().GetStop(),
×
291
                        func(start, end int) error {
×
292
                                fmt.Fprintf(sb, "q.AppendReturning(o.expr(%d, %d))\n", start, end)
×
293
                                return nil
×
294
                        },
×
295
                )...)
296
        }
297
}
298

299
func (v *visitor) modUpdate_stmt(ctx sqliteparser.IUpdate_stmtContext, sb *strings.Builder) {
×
300
        v.modWith_clause(ctx, sb)
×
301

×
302
        if or := ctx.GetUpsert_action(); or != nil {
×
NEW
303
                v.StmtRules = append(v.StmtRules, internal.RecordPoints(
×
304
                        or.GetStart(), or.GetStop(),
×
305
                        func(start, end int) error {
×
306
                                fmt.Fprintf(sb, "q.SetOr(o.raw(%d, %d))\n", start, end)
×
307
                                return nil
×
308
                        },
×
309
                )...)
310
        }
311

312
        qualifiedTable := ctx.Qualified_table_name()
×
313
        table := qualifiedTable.Table_name()
×
314
        v.quoteIdentifiable(table)
×
315

×
316
        tableStart := table.GetStart().GetStart()
×
317
        tableStop := table.GetStop().GetStop()
×
318

×
319
        if schema := qualifiedTable.Schema_name(); schema != nil {
×
320
                v.quoteIdentifiable(schema)
×
321
                tableStart = schema.GetStart().GetStart()
×
322
        }
×
323

NEW
324
        v.StmtRules = append(v.StmtRules, internal.RecordPoints(
×
325
                tableStart, tableStop,
×
326
                func(start, end int) error {
×
327
                        fmt.Fprintf(sb, "q.Table.Table = o.raw(%d, %d)\n", start, end)
×
328
                        return nil
×
329
                },
×
330
        )...)
331

332
        if alias := qualifiedTable.Table_alias(); alias != nil {
×
333
                v.quoteIdentifiable(alias)
×
NEW
334
                v.StmtRules = append(v.StmtRules, internal.RecordPoints(
×
335
                        alias.GetStart().GetStart(),
×
336
                        alias.GetStop().GetStop(),
×
337
                        func(start, end int) error {
×
338
                                fmt.Fprintf(sb, "q.Table.Alias = %q\n", getName(alias))
×
339
                                return nil
×
340
                        },
×
341
                )...)
342
        }
343

344
        indexName := qualifiedTable.Index_name()
×
345
        switch {
×
346
        case indexName != nil: // INDEXED BY
×
347
                fmt.Fprintf(
×
348
                        sb,
×
349
                        "index := %q; q.Table.IndexedBy = &index\n",
×
350
                        getName(indexName),
×
351
                )
×
352
        case ctx.Qualified_table_name().NOT_() != nil: // NOT INDEXED
×
353
                sb.WriteString("index := \"\"; q.Table.IndexedBy = &index\n")
×
354
        }
355

356
        cols := ctx.AllColumn_name_or_list()
×
357
        exprs := ctx.AllExpr()
×
358

×
NEW
359
        v.StmtRules = append(v.StmtRules, internal.RecordPoints(
×
360
                cols[0].GetStart().GetStart(),
×
361
                exprs[len(exprs)-1].GetStop().GetStop(),
×
362
                func(start, end int) error {
×
363
                        fmt.Fprintf(sb, "q.AppendSet(o.expr(%d, %d))\n", start, end)
×
364
                        return nil
×
365
                },
×
366
        )...)
367

368
        if from := ctx.From_item(); from != nil {
×
NEW
369
                v.StmtRules = append(v.StmtRules, internal.RecordPoints(
×
370
                        from.GetStart().GetStart(),
×
371
                        from.GetStop().GetStop(),
×
372
                        func(start, end int) error {
×
373
                                fmt.Fprintf(sb, "q.SetTable(o.expr(%d, %d))\n", start, end)
×
374
                                return nil
×
375
                        },
×
376
                )...)
377
        }
378

379
        if where := ctx.Where_stmt(); where != nil {
×
NEW
380
                v.StmtRules = append(v.StmtRules, internal.RecordPoints(
×
381
                        where.WHERE_().GetSymbol().GetStop()+1,
×
382
                        where.GetStop().GetStop(),
×
383
                        func(start, end int) error {
×
384
                                fmt.Fprintf(sb, "q.AppendWhere(o.expr(%d, %d))\n", start, end)
×
385
                                return nil
×
386
                        },
×
387
                )...)
388
        }
389

390
        if returning := ctx.Returning_clause(); returning != nil {
×
NEW
391
                v.StmtRules = append(v.StmtRules, internal.RecordPoints(
×
392
                        returning.RETURNING_().GetSymbol().GetStop()+1,
×
393
                        returning.GetStop().GetStop(),
×
394
                        func(start, end int) error {
×
395
                                fmt.Fprintf(sb, "q.AppendReturning(o.expr(%d, %d))\n", start, end)
×
396
                                return nil
×
397
                        },
×
398
                )...)
399
        }
400

401
        if order := ctx.Order_by_stmt(); order != nil {
×
NEW
402
                v.StmtRules = append(v.StmtRules, internal.RecordPoints(
×
403
                        order.BY_().GetSymbol().GetStop()+1,
×
404
                        order.GetStop().GetStop(),
×
405
                        func(start, end int) error {
×
406
                                fmt.Fprintf(sb, "q.AppendOrder(o.expr(%d, %d))\n", start, end)
×
407
                                return nil
×
408
                        },
×
409
                )...)
410
        }
411

412
        if limit := ctx.Limit_stmt(); limit != nil {
×
413
                if limit.COMMA() != nil {
×
NEW
414
                        v.Err = fmt.Errorf("LIMIT with comma is not supported")
×
415
                }
×
416

NEW
417
                v.StmtRules = append(v.StmtRules, internal.RecordPoints(
×
418
                        limit.GetFirstExpr().GetStart().GetStart(),
×
419
                        limit.GetFirstExpr().GetStop().GetStop(),
×
420
                        func(start, end int) error {
×
421
                                fmt.Fprintf(sb, "q.SetLimit(o.expr(%d, %d))\n", start, end)
×
422
                                return nil
×
423
                        },
×
424
                )...)
425

426
                if offset := limit.GetLastExpr(); offset != nil {
×
NEW
427
                        v.StmtRules = append(v.StmtRules, internal.RecordPoints(
×
428
                                offset.GetStart().GetStart(),
×
429
                                offset.GetStop().GetStop(),
×
430
                                func(start, end int) error {
×
431
                                        fmt.Fprintf(sb, "q.SetOffset(o.expr(%d, %d))\n", start, end)
×
432
                                        return nil
×
433
                                },
×
434
                        )...)
435
                }
436
        }
437
}
438

439
func (v *visitor) modDelete_stmt(ctx sqliteparser.IDelete_stmtContext, sb *strings.Builder) {
×
440
        v.modWith_clause(ctx, sb)
×
441

×
442
        qualifiedTable := ctx.Qualified_table_name()
×
443
        table := qualifiedTable.Table_name()
×
444
        v.quoteIdentifiable(table)
×
445

×
446
        tableStart := table.GetStart().GetStart()
×
447
        tableStop := table.GetStop().GetStop()
×
448

×
449
        if schema := qualifiedTable.Schema_name(); schema != nil {
×
450
                v.quoteIdentifiable(schema)
×
451
                tableStart = schema.GetStart().GetStart()
×
452
        }
×
453

NEW
454
        v.StmtRules = append(v.StmtRules, internal.RecordPoints(
×
455
                tableStart, tableStop,
×
456
                func(start, end int) error {
×
457
                        fmt.Fprintf(sb, "q.From.Table = o.raw(%d, %d)\n", start, end)
×
458
                        return nil
×
459
                },
×
460
        )...)
461

462
        if alias := qualifiedTable.Table_alias(); alias != nil {
×
463
                v.quoteIdentifiable(alias)
×
NEW
464
                v.StmtRules = append(v.StmtRules, internal.RecordPoints(
×
465
                        alias.GetStart().GetStart(),
×
466
                        alias.GetStop().GetStop(),
×
467
                        func(start, end int) error {
×
468
                                fmt.Fprintf(sb, "q.From.Alias = %q\n", getName(alias))
×
469
                                return nil
×
470
                        },
×
471
                )...)
472
        }
473

474
        indexName := qualifiedTable.Index_name()
×
475
        switch {
×
476
        case indexName != nil: // INDEXED BY
×
477
                fmt.Fprintf(
×
478
                        sb,
×
479
                        "index := %q; q.From.IndexedBy = &index\n",
×
480
                        getName(indexName),
×
481
                )
×
482
        case ctx.Qualified_table_name().NOT_() != nil: // NOT INDEXED
×
483
                sb.WriteString("index := \"\"; q.From.IndexedBy = &index\n")
×
484
        }
485

486
        if where := ctx.Where_stmt(); where != nil {
×
NEW
487
                v.StmtRules = append(v.StmtRules, internal.RecordPoints(
×
488
                        where.WHERE_().GetSymbol().GetStop()+1,
×
489
                        where.GetStop().GetStop(),
×
490
                        func(start, end int) error {
×
491
                                fmt.Fprintf(sb, "q.AppendWhere(o.expr(%d, %d))\n", start, end)
×
492
                                return nil
×
493
                        },
×
494
                )...)
495
        }
496

497
        if returning := ctx.Returning_clause(); returning != nil {
×
NEW
498
                v.StmtRules = append(v.StmtRules, internal.RecordPoints(
×
499
                        returning.RETURNING_().GetSymbol().GetStop()+1,
×
500
                        returning.GetStop().GetStop(),
×
501
                        func(start, end int) error {
×
502
                                fmt.Fprintf(sb, "q.AppendReturning(o.expr(%d, %d))\n", start, end)
×
503
                                return nil
×
504
                        },
×
505
                )...)
506
        }
507

508
        if order := ctx.Order_by_stmt(); order != nil {
×
NEW
509
                v.StmtRules = append(v.StmtRules, internal.RecordPoints(
×
510
                        order.BY_().GetSymbol().GetStop()+1,
×
511
                        order.GetStop().GetStop(),
×
512
                        func(start, end int) error {
×
513
                                fmt.Fprintf(sb, "q.AppendOrder(o.expr(%d, %d))\n", start, end)
×
514
                                return nil
×
515
                        },
×
516
                )...)
517
        }
518

519
        if limit := ctx.Limit_stmt(); limit != nil {
×
520
                if limit.COMMA() != nil {
×
NEW
521
                        v.Err = fmt.Errorf("LIMIT with comma is not supported")
×
522
                }
×
523

NEW
524
                v.StmtRules = append(v.StmtRules, internal.RecordPoints(
×
525
                        limit.GetFirstExpr().GetStart().GetStart(),
×
526
                        limit.GetFirstExpr().GetStop().GetStop(),
×
527
                        func(start, end int) error {
×
528
                                fmt.Fprintf(sb, "q.SetLimit(o.expr(%d, %d))\n", start, end)
×
529
                                return nil
×
530
                        },
×
531
                )...)
532

533
                if offset := limit.GetLastExpr(); offset != nil {
×
NEW
534
                        v.StmtRules = append(v.StmtRules, internal.RecordPoints(
×
535
                                offset.GetStart().GetStart(),
×
536
                                offset.GetStop().GetStop(),
×
537
                                func(start, end int) error {
×
538
                                        fmt.Fprintf(sb, "q.SetOffset(o.expr(%d, %d))\n", start, end)
×
539
                                        return nil
×
540
                                },
×
541
                        )...)
542
                }
543
        }
544
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc