INNER CODE UNIT · Go
init
mergestat/mergestat-lite · cmd/export.go:21
func init() {
exportCmd.Flags().StringArrayVarP(&exports, "exports", "e", []string{}, "queries to export, supplied as string pairs")
exportCmd.Flags().BoolVarP(&append, "append", "a", false, "append mode: insert into tables rather than creating new ones")
}
var exportCmd = &cobra.Command{
Use: "export [sqlite db file]",
Short: "Export queries into a SQLite db file",
Long: `Use this command to export queries into a SQLite database file on disk`,
Args: cobra.ExactArgs(1),
Run: func(cmd *cobra.Command, args []string) {
var err error
if len(exports) == 0 {
handleExitError(fmt.Errorf("please supply at least one export pair"))
}
if len(exports)%2 != 0 {