Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
hrl20 committed Dec 23, 2024
1 parent 5f80b1c commit 4044780
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 23 deletions.
5 changes: 2 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
@@ -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
Expand Down
6 changes: 2 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down Expand Up @@ -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=
Expand Down
14 changes: 0 additions & 14 deletions pkg/plugin/duckdb_driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
"database/sql"
"database/sql/driver"
"encoding/json"
"log"
"os"
"reflect"
"regexp"
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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
// }
2 changes: 0 additions & 2 deletions src/queryDefaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 4044780

Please sign in to comment.