cli: up all limits to 1000000 since it's a trusted environment.

This commit is contained in:
fiatjaf
2023-12-23 21:51:04 -03:00
parent 0cf1582cb7
commit c444065a08
3 changed files with 29 additions and 8 deletions

View File

@@ -11,8 +11,8 @@ import (
var delete_ = &cli.Command{
Name: "delete",
Usage: "deletes an event and all its associated index entries",
Description: ``,
Usage: "deletes an event by id and all its associated index entries",
Description: "",
Action: func(ctx context.Context, c *cli.Command) error {
hasError := false
for line := range getStdinLinesOrFirstArgument(c) {

View File

@@ -67,15 +67,36 @@ var app = &cli.Command{
switch typ {
case "sqlite":
db = &sqlite3.SQLite3Backend{DatabaseURL: path}
db = &sqlite3.SQLite3Backend{
DatabaseURL: path,
QueryLimit: 1_000_000,
QueryAuthorsLimit: 1_000_000,
QueryKindsLimit: 1_000_000,
QueryIDsLimit: 1_000_000,
QueryTagsLimit: 1_000_000,
}
case "lmdb":
db = &lmdb.LMDBBackend{Path: path, MaxLimit: 5000}
db = &lmdb.LMDBBackend{Path: path, MaxLimit: 1_000_000}
case "badger":
db = &badger.BadgerBackend{Path: path, MaxLimit: 5000}
db = &badger.BadgerBackend{Path: path, MaxLimit: 1_000_000}
case "postgres", "postgresql":
db = &postgresql.PostgresBackend{DatabaseURL: path}
db = &postgresql.PostgresBackend{
DatabaseURL: path,
QueryLimit: 1_000_000,
QueryAuthorsLimit: 1_000_000,
QueryKindsLimit: 1_000_000,
QueryIDsLimit: 1_000_000,
QueryTagsLimit: 1_000_000,
}
case "mysql":
db = &mysql.MySQLBackend{DatabaseURL: path}
db = &mysql.MySQLBackend{
DatabaseURL: path,
QueryLimit: 1_000_000,
QueryAuthorsLimit: 1_000_000,
QueryKindsLimit: 1_000_000,
QueryIDsLimit: 1_000_000,
QueryTagsLimit: 1_000_000,
}
case "elasticsearch":
db = &elasticsearch.ElasticsearchStorage{URL: path}
case "":

View File

@@ -13,7 +13,7 @@ import (
var query = &cli.Command{
Name: "query",
Usage: "queries an eventstore for events, takes a Nostr filter as argument",
Description: ``,
Description: "unless specified to be smaller, up to a million results will be returned",
Action: func(ctx context.Context, c *cli.Command) error {
hasError := false
for line := range getStdinLinesOrFirstArgument(c) {