Skip to content

Commit

Permalink
integrate with chsql extension
Browse files Browse the repository at this point in the history
  • Loading branch information
lmangani authored Jul 10, 2024
1 parent e1a866f commit c4d088a
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions quackpipe.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ import (
//go:embed play.html
var staticPlay string

//go:embed aliases.sql
var staticAliases string

// params for Flags
type CommandLineFlags struct {
Host *string `json:"host"`
Expand Down Expand Up @@ -69,8 +66,8 @@ func quack(query string, stdin bool, format string, params string, hashdb string
check(db.ExecContext(context.Background(),"SET autoload_known_extensions=1;"))
}

if (alias) && (staticAliases != "") {
check(db.ExecContext(context.Background(), staticAliases))
if (alias) {
check(db.ExecContext(context.Background(), "INSTALL chsql FROM community; LOAD chsql;"))
}

if (md) && (motherduck != "") {
Expand Down Expand Up @@ -106,7 +103,7 @@ func initFlags() {
appFlags.Params = flag.String("params", "", "DuckDB optional parameters. Default to none.")
appFlags.DBPath = flag.String("dbpath", "/tmp/", "DuckDB DB storage path. Default to /tmp/")
appFlags.Stdin = flag.Bool("stdin", false, "STDIN query. Default false")
appFlags.Alias = flag.Bool("alias", false, "Built-in CH Aliases. Default false")
appFlags.Alias = flag.Bool("alias", true, "Built-in CH Aliases. Default true")
flag.Parse()
}

Expand Down

0 comments on commit c4d088a

Please sign in to comment.