diff --git a/ext/array/array.go b/ext/array/array.go index 619e975..3e111f0 100644 --- a/ext/array/array.go +++ b/ext/array/array.go @@ -62,7 +62,7 @@ func (c *cursor) RowID() (int64, error) { return int64(c.rowID), nil } -func (c *cursor) Column(ctx *sqlite3.Context, n int) error { +func (c *cursor) Column(ctx sqlite3.Context, n int) error { if n != 0 { return nil } diff --git a/ext/array/array_test.go b/ext/array/array_test.go index be97d7c..4b279ea 100644 --- a/ext/array/array_test.go +++ b/ext/array/array_test.go @@ -120,7 +120,7 @@ func Test_cursor_Column(t *testing.T) { want = want[1:] } if err := rows.Err(); err != nil { - log.Fatal(err) + t.Fatal(err) } } diff --git a/ext/bloom/bloom.go b/ext/bloom/bloom.go index c317f4b..46190a9 100644 --- a/ext/bloom/bloom.go +++ b/ext/bloom/bloom.go @@ -307,7 +307,7 @@ func (c *cursor) Filter(idxNum int, idxStr string, arg ...sqlite3.Value) error { return nil } -func (c *cursor) Column(ctx *sqlite3.Context, n int) error { +func (c *cursor) Column(ctx sqlite3.Context, n int) error { if ctx.VTabNoChange() { return nil } diff --git a/ext/csv/csv.go b/ext/csv/csv.go index bb1924e..d9d0951 100644 --- a/ext/csv/csv.go +++ b/ext/csv/csv.go @@ -239,7 +239,7 @@ func (c *cursor) RowID() (int64, error) { return c.rowID, nil } -func (c *cursor) Column(ctx *sqlite3.Context, col int) error { +func (c *cursor) Column(ctx sqlite3.Context, col int) error { if col < len(c.row) { typ := text if col < len(c.table.typs) { diff --git a/ext/fileio/fsdir.go b/ext/fileio/fsdir.go index eff67f1..77d0d49 100644 --- a/ext/fileio/fsdir.go +++ b/ext/fileio/fsdir.go @@ -114,7 +114,7 @@ func (c *cursor) RowID() (int64, error) { return c.rowID, nil } -func (c *cursor) Column(ctx *sqlite3.Context, n int) error { +func (c *cursor) Column(ctx sqlite3.Context, n int) error { switch n { case 0: // name name := strings.TrimPrefix(c.curr.path, c.base) diff --git a/ext/lines/lines.go b/ext/lines/lines.go index 7c30f86..ac5abd1 100644 --- a/ext/lines/lines.go +++ b/ext/lines/lines.go @@ -91,7 +91,7 @@ func (c *cursor) RowID() (int64, error) { return c.rowID, nil } -func (c *cursor) Column(ctx *sqlite3.Context, n int) error { +func (c *cursor) Column(ctx sqlite3.Context, n int) error { if n == 0 { ctx.ResultRawText(c.line) } diff --git a/ext/pivot/pivot.go b/ext/pivot/pivot.go index d410f92..d48e6cb 100644 --- a/ext/pivot/pivot.go +++ b/ext/pivot/pivot.go @@ -225,7 +225,7 @@ func (c *cursor) RowID() (int64, error) { return c.rowID, nil } -func (c *cursor) Column(ctx *sqlite3.Context, col int) error { +func (c *cursor) Column(ctx sqlite3.Context, col int) error { count := c.scan.ColumnCount() if col < count { ctx.ResultValue(c.scan.ColumnValue(col)) diff --git a/ext/statement/stmt.go b/ext/statement/stmt.go index 917dcdb..9e08a6d 100644 --- a/ext/statement/stmt.go +++ b/ext/statement/stmt.go @@ -201,7 +201,7 @@ func (c *cursor) RowID() (int64, error) { return c.rowID, nil } -func (c *cursor) Column(ctx *sqlite3.Context, col int) error { +func (c *cursor) Column(ctx sqlite3.Context, col int) error { switch outputs := c.stmt.ColumnCount(); { case col < outputs: ctx.ResultValue(c.stmt.ColumnValue(col)) diff --git a/vtab.go b/vtab.go index 7c19330..3bbff6d 100644 --- a/vtab.go +++ b/vtab.go @@ -247,7 +247,7 @@ type VTabCursor interface { // https://sqlite.org/vtab.html#xeof EOF() bool // https://sqlite.org/vtab.html#xcolumn - Column(ctx *Context, n int) error + Column(ctx Context, n int) error // https://sqlite.org/vtab.html#xrowid RowID() (int64, error) } @@ -618,7 +618,7 @@ func cursorNextCallback(ctx context.Context, mod api.Module, pCur uint32) uint32 func cursorColumnCallback(ctx context.Context, mod api.Module, pCur, pCtx uint32, n int32) uint32 { cursor := vtabGetHandle(ctx, mod, pCur).(VTabCursor) db := ctx.Value(connKey{}).(*Conn) - err := cursor.Column(&Context{db, pCtx}, int(n)) + err := cursor.Column(Context{db, pCtx}, int(n)) return vtabError(ctx, mod, pCur, _CURSOR_ERROR, err) } diff --git a/vtab_test.go b/vtab_test.go index 1686c23..acdf47f 100644 --- a/vtab_test.go +++ b/vtab_test.go @@ -92,7 +92,7 @@ func (cur *seriesCursor) Filter(idxNum int, idxStr string, arg ...sqlite3.Value) return nil } -func (cur *seriesCursor) Column(ctx *sqlite3.Context, col int) error { +func (cur *seriesCursor) Column(ctx sqlite3.Context, col int) error { switch col { case 0: ctx.ResultInt64(cur.value)