mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
--limit= mechanism plus new limits for facets
Replaced the --max_returned_rows and --sql_time_limit_ms options to "datasette serve" with a new --limit option, which supports a larger list of limits. Example usage: datasette serve --limit max_returned_rows:1000 \ --limit sql_time_limit_ms:2500 \ --limit default_facet_size:50 \ --limit facet_time_limit_ms:1000 \ --limit facet_suggest_time_limit_ms:500 New docs: https://datasette.readthedocs.io/en/latest/limits.html Closes #270 Closes #264
This commit is contained in:
parent
8003a13331
commit
cef9a9a870
10 changed files with 118 additions and 72 deletions
|
|
@ -21,10 +21,12 @@ def app_client(sql_time_limit_ms=None, max_returned_rows=None):
|
|||
ds = Datasette(
|
||||
[filepath],
|
||||
page_size=50,
|
||||
max_returned_rows=max_returned_rows or 100,
|
||||
sql_time_limit_ms=sql_time_limit_ms or 200,
|
||||
metadata=METADATA,
|
||||
plugins_dir=plugins_dir,
|
||||
limits={
|
||||
'max_returned_rows': max_returned_rows or 100,
|
||||
'sql_time_limit_ms': sql_time_limit_ms or 200,
|
||||
}
|
||||
)
|
||||
ds.sqlite_functions.append(
|
||||
('sleep', 1, lambda n: time.sleep(float(n))),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue