From 404478036902f221ea57965b28cae5fe64766e1c Mon Sep 17 00:00:00 2001 From: Louisa Huang Date: Mon, 23 Dec 2024 11:20:12 -0500 Subject: [PATCH] clean up --- go.mod | 5 ++--- go.sum | 6 ++---- pkg/plugin/duckdb_driver.go | 14 -------------- src/queryDefaults.ts | 2 -- 4 files changed, 4 insertions(+), 23 deletions(-) diff --git a/go.mod b/go.mod index 7ed11d5..552fe02 100644 --- a/go.mod +++ b/go.mod @@ -1,20 +1,19 @@ module github.com/motherduck/duckdb-datasource -go 1.22.7 +go 1.23 toolchain go1.23.4 require ( github.com/grafana/grafana-plugin-sdk-go v0.260.3 github.com/grafana/sqlds/v3 v3.2.0 - github.com/marcboeker/go-duckdb v1.7.0 + github.com/marcboeker/go-duckdb v1.8.3 github.com/mitchellh/mapstructure v1.5.0 ) require ( github.com/BurntSushi/toml v1.4.0 // indirect github.com/apache/arrow-go/v18 v18.0.1-0.20241212180703-82be143d7c30 // indirect - github.com/apache/arrow/go/v14 v14.0.2 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/cenkalti/backoff/v4 v4.3.0 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect diff --git a/go.sum b/go.sum index 0c4911e..841de16 100644 --- a/go.sum +++ b/go.sum @@ -5,8 +5,6 @@ github.com/andybalholm/brotli v1.1.1 h1:PR2pgnyFznKEugtsUo0xLdDop5SKXd5Qf5ysW+7X github.com/andybalholm/brotli v1.1.1/go.mod h1:05ib4cKhjx3OQYUY22hTVd34Bc8upXjOLL2rKwwZBoA= github.com/apache/arrow-go/v18 v18.0.1-0.20241212180703-82be143d7c30 h1:hXVi7QKuCQ0E8Yujfu9b0f0RnzZ72efpWvPnZgnJPrE= github.com/apache/arrow-go/v18 v18.0.1-0.20241212180703-82be143d7c30/go.mod h1:RNuWDIiGjq5nndL2PyQrndUy9nMLwheA3uWaAV7fe4U= -github.com/apache/arrow/go/v14 v14.0.2 h1:N8OkaJEOfI3mEZt07BIkvo4sC6XDbL+48MBPWO5IONw= -github.com/apache/arrow/go/v14 v14.0.2/go.mod h1:u3fgh3EdgN/YQ8cVQRguVW3R+seMybFg8QBQ5LU+eBY= github.com/apache/thrift v0.21.0 h1:tdPmh/ptjE1IJnhbhrcl2++TauVjy242rkV/UzJChnE= github.com/apache/thrift v0.21.0/go.mod h1:W1H8aR/QRtYNvrPeFXBtobyRkd0/YVhTc6i07XIAgDw= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= @@ -126,8 +124,8 @@ github.com/magefile/mage v1.15.0 h1:BvGheCMAsG3bWUDbZ8AyXXpCNwU9u5CB6sM+HNb9HYg= github.com/magefile/mage v1.15.0/go.mod h1:z5UZb/iS3GoOSn0JgWuiw7dxlurVYTu+/jHXqQg881A= github.com/mailru/easyjson v0.7.7 h1:UGYAvKxe3sBsEDzO8ZeWOSlIQfWFlxbzLZe7hwFURr0= github.com/mailru/easyjson v0.7.7/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc= -github.com/marcboeker/go-duckdb v1.7.0 h1:c9DrS13ta+gqVgg9DiEW8I+PZBE85nBMLL/YMooYoUY= -github.com/marcboeker/go-duckdb v1.7.0/go.mod h1:WtWeqqhZoTke/Nbd7V9lnBx7I2/A/q0SAq/urGzPCMs= +github.com/marcboeker/go-duckdb v1.8.3 h1:ZkYwiIZhbYsT6MmJsZ3UPTHrTZccDdM4ztoqSlEMXiQ= +github.com/marcboeker/go-duckdb v1.8.3/go.mod h1:C9bYRE1dPYb1hhfu/SSomm78B0FXmNgRvv6YBW/Hooc= github.com/mattetti/filebuffer v1.0.1 h1:gG7pyfnSIZCxdoKq+cPa8T0hhYtD9NxCdI4D7PTjRLM= github.com/mattetti/filebuffer v1.0.1/go.mod h1:YdMURNDOttIiruleeVr6f56OrMc+MydEnTcXwtkxNVs= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= diff --git a/pkg/plugin/duckdb_driver.go b/pkg/plugin/duckdb_driver.go index aeae15e..c9b3c94 100644 --- a/pkg/plugin/duckdb_driver.go +++ b/pkg/plugin/duckdb_driver.go @@ -5,7 +5,6 @@ import ( "database/sql" "database/sql/driver" "encoding/json" - "log" "os" "reflect" "regexp" @@ -77,12 +76,10 @@ func (d *DuckDBDriver) Connect(ctx context.Context, settings backend.DataSourceI // Join all parts with '&' to form the final query string // queryString := strings.Join(parts, "&") // dbString := strings.Join([]string{dbPath, queryString}, "?") - log.Default().Printf("Connecting to DuckDB with %s\n", config.Path) connector, err := duckdb.NewConnector(config.Path, func(execer driver.ExecerContext) error { bootQueries := []string{ "INSTALL 'motherduck'", "LOAD 'motherduck'", - "SELECT * FROM duckdb_extensions()", } for _, query := range bootQueries { @@ -447,14 +444,3 @@ func GetConverterList() []sqlutil.Converter { //}, return append(converters, strConverters...) } - -// // Driver is a simple interface that defines how to connect to a backend SQL datasource -// // Plugin creators will need to implement this in order to create a managed datasource -// type Driver interface { -// // Connect connects to the database. It does not need to call `db.Ping()` -// Connect(context.Context, backend.DataSourceInstanceSettings, json.RawMessage) (*sql.DB, error) -// // Settings are read whenever the plugin is initialized, or after the data source settings are updated -// Settings(context.Context, backend.DataSourceInstanceSettings) DriverSettings -// Macros() Macros -// Converters() []sqlutil.Converter -// } diff --git a/src/queryDefaults.ts b/src/queryDefaults.ts index 27f0b67..aab3703 100644 --- a/src/queryDefaults.ts +++ b/src/queryDefaults.ts @@ -3,8 +3,6 @@ import { createFunctionField, setGroupByField } from './sqlUtil'; export function applyQueryDefaults(q?: SQLQuery): SQLQuery { - console.log('EEEEEEE applyQueryDefaults = ', q?.format); - console.log('EEEEEEE queryforma.Table = ', QueryFormat.Table); let editorMode = q?.editorMode || EditorMode.Builder; // Switching to code editor if the query was created before visual query builder was introduced.