issue-28: added default limit as a setting (#29)

This commit is contained in:
Leon Mika 2022-09-30 22:28:59 +10:00 committed by GitHub
parent 93ec519127
commit efdc7f9e25
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 194 additions and 148 deletions

View file

@ -34,6 +34,7 @@ func main() {
var flagLocal = flag.String("local", "", "local endpoint")
var flagDebug = flag.String("debug", "", "file to log debug messages")
var flagRO = flag.Bool("ro", false, "enable readonly mode")
var flagDefaultLimit = flag.Int("default-limit", 0, "default limit for queries and scans")
var flagWorkspace = flag.String("w", "", "workspace file")
flag.Parse()
@ -82,6 +83,11 @@ func main() {
cli.Fatalf("unable to set read-only mode: %v", err)
}
}
if *flagDefaultLimit > 0 {
if err := settingStore.SetDefaultLimit(*flagDefaultLimit); err != nil {
cli.Fatalf("unable to set default limit: %v", err)
}
}
tableService := tables.NewService(dynamoProvider, settingStore)
workspaceService := workspaces_service.NewService(resultSetSnapshotStore)