mirror of
https://github.com/featurebasedb/featurebase.git
synced 2026-08-28 10:54:59 +00:00
* first cut at pre-sort command that works on ndjson * finish pre_sort command for CSV and JSON and add test * try fixing golangci-lint * remove some dumb lint checks * more linter disabling * take .golangci.yml from previous repo * go fmt (facepalm) * remove ioutil to fix lint
38 lines
785 B
Go
38 lines
785 B
Go
package main
|
|
|
|
import (
|
|
"log"
|
|
"os"
|
|
|
|
"github.com/featurebasedb/featurebase/v3/idk/sql"
|
|
"github.com/featurebasedb/featurebase/v3/logger"
|
|
"github.com/jaffee/commandeer/pflag"
|
|
)
|
|
|
|
func main() {
|
|
m := sql.NewMain()
|
|
if err := pflag.LoadEnv(m, "IDK_", nil); err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
m.Rename()
|
|
if m.DryRun {
|
|
log.Printf("%+v\n", m)
|
|
return
|
|
}
|
|
|
|
if m.Concurrency != 1 {
|
|
m.Log().Infof("Concurrency is not supported for sql ingest. '--concurrency' flag will be ignored.")
|
|
m.Concurrency = 1
|
|
}
|
|
|
|
if err := m.Run(); err != nil {
|
|
log := m.Log()
|
|
if log == nil {
|
|
// if we fail before a logger was instantiated
|
|
logger.NewStandardLogger(os.Stderr).Errorf("Error running command: %v", err)
|
|
os.Exit(1)
|
|
}
|
|
log.Errorf("Error running command: %v", err)
|
|
os.Exit(1)
|
|
}
|
|
}
|