diff options
author | David Vassallo <davevassallo@gmail.com> | 2022-10-19 02:04:52 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-18 19:04:52 -0400 |
commit | 4b8633cceb34c8b04fb740efef9b79e50fedbcca (patch) | |
tree | aea96b53426ded707b2fabfdf34324983c8468d8 | |
parent | Update README.md to include vtable feature (#1100) (diff) | |
download | golite-4b8633cceb34c8b04fb740efef9b79e50fedbcca.tar.gz golite-4b8633cceb34c8b04fb740efef9b79e50fedbcca.tar.xz |
Updating vtable example, "BestIndex" method (#1099)
As it was, the vtable example will give an error when adding any kind of SQL constraint in the SQL statement. Updating the BestIndex method will ensure that adding SQL constraints will not result in errors
Signed-off-by: David Vassallo <davevassallo@gmail.com>
Signed-off-by: David Vassallo <davevassallo@gmail.com>
-rw-r--r-- | _example/vtable/vtable.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/_example/vtable/vtable.go b/_example/vtable/vtable.go index 1d6d824..dd457ea 100644 --- a/_example/vtable/vtable.go +++ b/_example/vtable/vtable.go @@ -63,7 +63,12 @@ func (v *ghRepoTable) Open() (sqlite3.VTabCursor, error) { } func (v *ghRepoTable) BestIndex(cst []sqlite3.InfoConstraint, ob []sqlite3.InfoOrderBy) (*sqlite3.IndexResult, error) { - return &sqlite3.IndexResult{}, nil + used := make([]bool, len(csts)) + return &sqlite3.IndexResult{ + IdxNum: 0, + IdxStr: "default", + Used: used, + }, nil } func (v *ghRepoTable) Disconnect() error { return nil } |