Refactor CREATE parser. (#111)

This commit is contained in:
Nuno Cruces
2024-07-03 14:06:07 +01:00
committed by GitHub
parent 90f7e502be
commit 5a4c7a58c4
12 changed files with 291 additions and 100 deletions

View File

@@ -1,7 +1,6 @@
package csv
import (
_ "embed"
"strings"
"github.com/ncruces/go-sqlite3/util/vtabutil"
@@ -22,12 +21,10 @@ func getColumnAffinities(schema string) ([]affinity, error) {
if err != nil {
return nil, err
}
defer tab.Close()
types := make([]affinity, tab.NumColumns())
for i := range types {
col := tab.Column(i)
types[i] = getAffinity(col.Type())
types := make([]affinity, len(tab.Columns))
for i, col := range tab.Columns {
types[i] = getAffinity(col.Type)
}
return types, nil
}

View File

@@ -1,9 +1,6 @@
package csv
import (
_ "embed"
"testing"
)
import "testing"
func Test_getAffinity(t *testing.T) {
tests := []struct {