Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ?_nofacet=1 #76

Closed
simonw opened this issue Jul 16, 2021 · 2 comments
Closed

Use ?_nofacet=1 #76

simonw opened this issue Jul 16, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@simonw
Copy link
Owner

simonw commented Jul 16, 2021

Added in https://docs.datasette.io/en/stable/changelog.html#v0-57 - looks like I forgot to do this in #61.

@simonw simonw added the enhancement New feature or request label Jul 16, 2021
@simonw
Copy link
Owner Author

simonw commented Jul 16, 2021

Currently we call this endpoint:

qs = {}
qs.update(pairs)
if after:
qs["_next"] = after
qs["_size"] = first
if search and meta.supports_fts:
qs["_search"] = search
if related_fk:
related_column = meta.graphql_columns.get(
related_fk.column, related_fk.column
)
related_other_column = table_metadata[
related_fk.other_table
].graphql_columns.get(related_fk.other_column, related_fk.other_column)
qs[related_column] = getattr(root, related_other_column)
if where:
qs["_where"] = where
if sort:
qs["_sort"] = column_name_rev[sort]
elif sort_desc:
qs["_sort_desc"] = column_name_rev[sort_desc]
path_with_query_string = "/{}/{}.json?{}".format(
database_name, table_name, urllib.parse.urlencode(qs)
)

@simonw
Copy link
Owner Author

simonw commented Jul 16, 2021

Using _nocount=1 isn't right here because of this code that reads the total count:

def resolve_totalCount(parent, info):
return parent["filtered_table_rows_count"]

@simonw simonw closed this as completed in adc8e35 Jul 16, 2021
@simonw simonw changed the title Use ?_nofacet=1 and ?_nocount=1 Use ?_nofacet=1 Jul 16, 2021
simonw added a commit that referenced this issue Jul 16, 2021
simonw added a commit that referenced this issue Jul 16, 2021
I was going to do this as a 1.4.1 dot-release, but since it bumps the minimum version of Datasette up to 0.57 installing this version could bump the underlying Datasette version significantly, so this needs to be a minor release, not a patch release.

Refs #61, #76
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant