File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 7
7
"fmt"
8
8
"os"
9
9
"os/exec"
10
+ "strings"
10
11
11
12
sdk "github.com/grafana/grafana-plugin-sdk-go/data"
12
13
"github.com/grafana/grafana-plugin-sdk-go/data/framestruct"
@@ -17,13 +18,15 @@ type DuckDB struct {
17
18
Name string
18
19
Mode string
19
20
Format string
21
+ Path string
20
22
Chunk int
21
23
}
22
24
23
25
type Opts struct {
24
26
Mode string
25
27
Format string
26
28
Chunk int
29
+ Path string
27
30
}
28
31
29
32
const newline = "\n "
@@ -40,13 +43,15 @@ func NewDuckDB(name string, opts ...Opts) DuckDB {
40
43
Name : name ,
41
44
Mode : defaultString (opts [0 ].Mode , "json" ),
42
45
Format : defaultString (opts [0 ].Format , "parquet" ),
46
+ Path : defaultString (opts [0 ].Path , "usr/local/bin/" ),
43
47
Chunk : defaultInt (opts [0 ].Chunk , 0 ),
44
48
}
45
49
}
46
50
return DuckDB {
47
51
Name : name ,
48
52
Mode : "json" ,
49
53
Format : "parquet" ,
54
+ Path : "usr/local/bin/" ,
50
55
Chunk : 0 ,
51
56
}
52
57
}
@@ -63,7 +68,8 @@ func (d *DuckDB) RunCommands(commands []string) (string, error) {
63
68
b .Write ([]byte (cmd ))
64
69
}
65
70
66
- cmd := exec .Command ("duckdb" , d .Name )
71
+ cli := fmt .Sprintf ("%sduckdb" , strings .TrimSpace (d .Path ))
72
+ cmd := exec .Command (cli , d .Name )
67
73
cmd .Stdin = & b
68
74
cmd .Stdout = & stdout
69
75
cmd .Stderr = & stderr
You can’t perform that action at this time.
0 commit comments