mirror of
https://github.com/simonw/datasette.git
synced 2025-12-10 16:51:24 +01:00
dedent SQL for neighborhood_search fixture
Makes this page a little prettier: https://latest.datasette.io/fixtures/neighborhood_search
This commit is contained in:
parent
6717c719dd
commit
b07312c2b3
1 changed files with 5 additions and 2 deletions
|
|
@ -11,6 +11,7 @@ import random
|
|||
import sys
|
||||
import string
|
||||
import tempfile
|
||||
import textwrap
|
||||
import time
|
||||
from urllib.parse import unquote, quote
|
||||
|
||||
|
|
@ -311,14 +312,16 @@ METADATA = {
|
|||
"𝐜𝐢𝐭𝐢𝐞𝐬": "select id, name from facet_cities order by id limit 1;",
|
||||
"pragma_cache_size": "PRAGMA cache_size;",
|
||||
"neighborhood_search": {
|
||||
"sql": """
|
||||
"sql": textwrap.dedent(
|
||||
"""
|
||||
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",
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue