sq/main.go
Neil O'Toole a92b9abf34
Initial work on a JSON driver (#70)
* implementation work for json importers

* json driver checkpoint

* working on json.ParseObjectsInArray

* json.ParseObjectsInArray seems to be working

* checkpoint while tidying up ParseObjectsInArray

* more tidy checkpoint

* more tidy checkpoint 2

* tidying up ParseObjectsInArray

* tidy up

* code/docs cleanup

* more cleanup of json driver

* more cleanup of json driver

* flat json import seemingly working

* improvements to json driver

* json writer now prints empty [] for postgres empty tables
2020-10-20 09:05:43 -06:00

30 lines
458 B
Go

// Package main contains sq's main function.
package main
import (
"context"
"os"
"os/signal"
"github.com/neilotoole/sq/cli"
)
func main() {
ctx, cancelFn := context.WithCancel(context.Background())
defer cancelFn()
go func() {
stopCh := make(chan os.Signal, 1)
signal.Notify(stopCh, os.Interrupt)
<-stopCh
cancelFn()
}()
err := cli.Execute(ctx, os.Stdin, os.Stdout, os.Stderr, os.Args)
if err != nil {
cancelFn()
os.Exit(1)
}
}