diff --git a/cmd/africastalking/main.go b/cmd/africastalking/main.go index 4ca8400..0e330ae 100644 --- a/cmd/africastalking/main.go +++ b/cmd/africastalking/main.go @@ -43,12 +43,14 @@ func main() { var resourceDir string var size uint var database string + var dbSchema string var engineDebug bool var host string var port uint flag.StringVar(&dbDir, "dbdir", ".state", "database dir to read from") flag.StringVar(&resourceDir, "resourcedir", path.Join("services", "registration"), "resource dir") flag.StringVar(&database, "db", "gdbm", "database to be used") + flag.StringVar(&dbSchema, "schema", "public", "database schema to be used") flag.BoolVar(&engineDebug, "d", false, "use engine debug output") flag.UintVar(&size, "s", 160, "max size of output") flag.StringVar(&host, "h", initializers.GetEnv("HOST", "127.0.0.1"), "http host") @@ -59,6 +61,7 @@ func main() { ctx := context.Background() ctx = context.WithValue(ctx, "Database", database) + ctx = context.WithValue(ctx, "Schema", dbSchema) pfp := path.Join(scriptDir, "pp.csv") cfg := engine.Config{ diff --git a/cmd/async/main.go b/cmd/async/main.go index 51b9e40..91c28c6 100644 --- a/cmd/async/main.go +++ b/cmd/async/main.go @@ -53,6 +53,7 @@ func main() { var resourceDir string var size uint var database string + var dbSchema string var engineDebug bool var host string var port uint @@ -60,6 +61,7 @@ func main() { flag.StringVar(&dbDir, "dbdir", ".state", "database dir to read from") flag.StringVar(&resourceDir, "resourcedir", path.Join("services", "registration"), "resource dir") flag.StringVar(&database, "db", "gdbm", "database to be used") + flag.StringVar(&dbSchema, "schema", "public", "database schema to be used") flag.BoolVar(&engineDebug, "d", false, "use engine debug output") flag.UintVar(&size, "s", 160, "max size of output") flag.StringVar(&host, "h", initializers.GetEnv("HOST", "127.0.0.1"), "http host") @@ -70,6 +72,7 @@ func main() { ctx := context.Background() ctx = context.WithValue(ctx, "Database", database) + ctx = context.WithValue(ctx, "Schema", dbSchema) pfp := path.Join(scriptDir, "pp.csv") cfg := engine.Config{ diff --git a/cmd/http/main.go b/cmd/http/main.go index 46dbe91..69e31a1 100644 --- a/cmd/http/main.go +++ b/cmd/http/main.go @@ -42,12 +42,14 @@ func main() { var resourceDir string var size uint var database string + var dbSchema string var engineDebug bool var host string var port uint flag.StringVar(&dbDir, "dbdir", ".state", "database dir to read from") flag.StringVar(&resourceDir, "resourcedir", path.Join("services", "registration"), "resource dir") flag.StringVar(&database, "db", "gdbm", "database to be used") + flag.StringVar(&dbSchema, "schema", "public", "database schema to be used") flag.BoolVar(&engineDebug, "d", false, "use engine debug output") flag.UintVar(&size, "s", 160, "max size of output") flag.StringVar(&host, "h", initializers.GetEnv("HOST", "127.0.0.1"), "http host") @@ -58,6 +60,7 @@ func main() { ctx := context.Background() ctx = context.WithValue(ctx, "Database", database) + ctx = context.WithValue(ctx, "Schema", dbSchema) pfp := path.Join(scriptDir, "pp.csv") cfg := engine.Config{ diff --git a/cmd/main.go b/cmd/main.go index fc6f147..484b6c1 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -36,9 +36,11 @@ func main() { var size uint var sessionId string var database string + var dbSchema string var engineDebug bool flag.StringVar(&sessionId, "session-id", "075xx2123", "session id") flag.StringVar(&database, "db", "gdbm", "database to be used") + flag.StringVar(&dbSchema, "schema", "public", "database schema to be used") flag.StringVar(&dbDir, "dbdir", ".state", "database dir to read from") flag.BoolVar(&engineDebug, "d", false, "use engine debug output") flag.UintVar(&size, "s", 160, "max size of output") @@ -49,6 +51,7 @@ func main() { ctx := context.Background() ctx = context.WithValue(ctx, "SessionId", sessionId) ctx = context.WithValue(ctx, "Database", database) + ctx = context.WithValue(ctx, "Schema", dbSchema) pfp := path.Join(scriptDir, "pp.csv") cfg := engine.Config{