Support title/description for canned queries, closes #342

Demo here: https://latest.datasette.io/fixtures/neighborhood_search
This commit is contained in:
Simon Willison 2018-07-15 19:33:30 -07:00
commit 6e37f091ed
No known key found for this signature in database
GPG key ID: 17E2DEA2588B7F52
9 changed files with 62 additions and 17 deletions

View file

@ -161,13 +161,18 @@ METADATA = {
},
'queries': {
'pragma_cache_size': 'PRAGMA cache_size;',
'neighborhood_search': '''
select neighborhood, facet_cities.name, state
from facetable
join facet_cities on facetable.city_id = facet_cities.id
where neighborhood like '%' || :text || '%'
order by neighborhood;
'''
'neighborhood_search': {
'sql': '''
select neighborhood, facet_cities.name, state
from facetable
join facet_cities
on facetable.city_id = facet_cities.id
where neighborhood like '%' || :text || '%'
order by neighborhood;
''',
'title': 'Search neighborhoods',
'description_html': '<b>Demonstrating</b> simple like search',
},
}
},
}