Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
hrl20 committed Jan 23, 2025
1 parent 0af0623 commit 9f224db
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 34 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/motherduckdb/grafana-duckdb-datasource/cmd/go-duckdb-helper
module github.com/motherduckdb/grafana-duckdb-datasource/cmd/preinstall-extensions

go 1.23

Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
// From https://github.com/snakedotdev/grafana-duckdb-datasource
// Apache 2.0 Licensed
// Copyright snakedotdev
// Modified from original version

package main

import (
Expand All @@ -13,8 +18,8 @@ import (

func main() {
var (
sqlCmd = flag.String("s", "", "SQL command to execute (multiple commands can be separated by semicolons)")
dbPath = flag.String("db", "", "Path to DuckDB database file (empty for in-memory)")
sqlCmd = flag.String("s", "", "SQL command to execute (multiple commands can be separated by semicolons)")
dbPath = flag.String("db", "", "Path to DuckDB database file (empty for in-memory)")
)

flag.Parse()
Expand Down Expand Up @@ -65,4 +70,4 @@ func main() {
}

fmt.Println("All commands executed successfully")
}
}
30 changes: 0 additions & 30 deletions pkg/plugin/duckdb_driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,36 +57,6 @@ func (d *DuckDBDriver) Connect(ctx context.Context, settings backend.DataSourceI
os.Setenv("motherduck_token", config.Secrets.MotherDuckToken)
}

// // join config as url parmaeters
// config, err := parseConfig(settings)

// if err != nil {
// return nil, err
// }

// // Create a slice to hold the URL-encoded key-value pairs
// var parts []string
// var dbPath string
// // Iterate through the map
// for key, value := range config {
// if key == "path" {
// dbPath = value
// continue
// } else if key == "apiKey" {
// }

// // URL-encode the key and the value
// encodedKey := url.QueryEscape(key)
// encodedValue := url.QueryEscape(value)

// // Append the encoded key-value pair to the slice
// parts = append(parts, fmt.Sprintf("%s=%s", encodedKey, encodedValue))
// }

// Join all parts with '&' to form the final query string
// queryString := strings.Join(parts, "&")
// dbString := strings.Join([]string{dbPath, queryString}, "?")

connector, err := duckdb.NewConnector(config.Path, func(execer driver.ExecerContext) error {
bootQueries := []string{}

Expand Down

0 comments on commit 9f224db

Please sign in to comment.