Skip to content

Commit 31eaef6

Browse files
committed
fix: lint
1 parent 131a176 commit 31eaef6

File tree

2 files changed

+38
-38
lines changed

2 files changed

+38
-38
lines changed

pkg/parser/ast.go

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -267,9 +267,9 @@ func (ds *DeleteStatement) String() string {
267267
type MergeStatement struct {
268268
BaseNode
269269
TargetTable TableReference
270-
SourceTable interface{} // Can be TableReference or SelectStatement
271-
SourceAlias string // Alias for source
272-
OnCondition Expression // MERGE condition
270+
SourceTable interface{} // Can be TableReference or SelectStatement
271+
SourceAlias string // Alias for source
272+
OnCondition Expression // MERGE condition
273273
WhenMatched []*MergeWhenClause // WHEN MATCHED clauses (can have multiple)
274274
WhenNotMatched []*MergeWhenClause // WHEN NOT MATCHED clauses
275275
WhenNotMatchedBy []*MergeWhenClause // WHEN NOT MATCHED BY SOURCE (SQL Server)
@@ -284,13 +284,13 @@ func (ms *MergeStatement) String() string {
284284
// MergeWhenClause represents a WHEN clause in MERGE
285285
type MergeWhenClause struct {
286286
BaseNode
287-
Matched bool // true for WHEN MATCHED, false for WHEN NOT MATCHED
288-
BySource bool // true for WHEN NOT MATCHED BY SOURCE (SQL Server)
289-
Condition Expression // Optional AND condition
290-
Action *MergeAction // The action to perform
287+
Matched bool // true for WHEN MATCHED, false for WHEN NOT MATCHED
288+
BySource bool // true for WHEN NOT MATCHED BY SOURCE (SQL Server)
289+
Condition Expression // Optional AND condition
290+
Action *MergeAction // The action to perform
291291
}
292292

293-
func (mwc *MergeWhenClause) Type() string { return "MergeWhenClause" }
293+
func (mwc *MergeWhenClause) Type() string { return "MergeWhenClause" }
294294
func (mwc *MergeWhenClause) String() string {
295295
if mwc.Matched {
296296
return "WHEN MATCHED"
@@ -1042,8 +1042,8 @@ func (ocs *OpenCursorStatement) String() string { return fmt.Sprintf("OPEN %s",
10421042
// FetchStatement represents FETCH cursor
10431043
type FetchStatement struct {
10441044
BaseNode
1045-
Direction string // NEXT, PRIOR, FIRST, LAST, ABSOLUTE, RELATIVE (empty for simple FETCH)
1046-
Count int // For ABSOLUTE/RELATIVE n (0 means not specified)
1045+
Direction string // NEXT, PRIOR, FIRST, LAST, ABSOLUTE, RELATIVE (empty for simple FETCH)
1046+
Count int // For ABSOLUTE/RELATIVE n (0 means not specified)
10471047
CursorName string
10481048
Variables []string // INTO variables
10491049
}

tests/cursor_test.go

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -143,22 +143,22 @@ func TestFetchWithInto(t *testing.T) {
143143

144144
func TestDeallocateStatement(t *testing.T) {
145145
tests := []struct {
146-
name string
147-
deallocSQL string
148-
dialect string
149-
cursorName string
146+
name string
147+
deallocSQL string
148+
dialect string
149+
cursorName string
150150
}{
151151
{
152-
name: "Simple DEALLOCATE",
153-
deallocSQL: `DEALLOCATE my_cursor`,
154-
dialect: "postgresql",
155-
cursorName: "my_cursor",
152+
name: "Simple DEALLOCATE",
153+
deallocSQL: `DEALLOCATE my_cursor`,
154+
dialect: "postgresql",
155+
cursorName: "my_cursor",
156156
},
157157
{
158-
name: "DEALLOCATE PREPARE (MySQL)",
159-
deallocSQL: `DEALLOCATE PREPARE stmt1`,
160-
dialect: "mysql",
161-
cursorName: "stmt1",
158+
name: "DEALLOCATE PREPARE (MySQL)",
159+
deallocSQL: `DEALLOCATE PREPARE stmt1`,
160+
dialect: "mysql",
161+
cursorName: "stmt1",
162162
},
163163
}
164164

@@ -193,28 +193,28 @@ func TestDeallocateStatement(t *testing.T) {
193193
func TestCursorLifecycle(t *testing.T) {
194194
// Test a complete cursor lifecycle: DECLARE, OPEN, FETCH, CLOSE, DEALLOCATE
195195
tests := []struct {
196-
name string
197-
cursorSQL string
198-
dialect string
199-
stmtType string
196+
name string
197+
cursorSQL string
198+
dialect string
199+
stmtType string
200200
}{
201201
{
202-
name: "OPEN cursor",
203-
cursorSQL: `OPEN my_cursor`,
204-
dialect: "mysql",
205-
stmtType: "OpenCursorStatement",
202+
name: "OPEN cursor",
203+
cursorSQL: `OPEN my_cursor`,
204+
dialect: "mysql",
205+
stmtType: "OpenCursorStatement",
206206
},
207207
{
208-
name: "FETCH simple",
209-
cursorSQL: `FETCH my_cursor`,
210-
dialect: "mysql",
211-
stmtType: "FetchStatement",
208+
name: "FETCH simple",
209+
cursorSQL: `FETCH my_cursor`,
210+
dialect: "mysql",
211+
stmtType: "FetchStatement",
212212
},
213213
{
214-
name: "CLOSE cursor",
215-
cursorSQL: `CLOSE my_cursor`,
216-
dialect: "postgresql",
217-
stmtType: "CloseStatement",
214+
name: "CLOSE cursor",
215+
cursorSQL: `CLOSE my_cursor`,
216+
dialect: "postgresql",
217+
stmtType: "CloseStatement",
218218
},
219219
}
220220

0 commit comments

Comments
 (0)