Ray Voelker
ray.voelker@gmail.com
ray.voelker@cincinnatilibrary.org
-- how many of each item type?
select
distinct item.item_format,
count(item.item_record_num) as count_total_items
from
item
group by
item.item_format
having
count(item.item_record_num) >= 1000
order by
count_total_items DESC
Named parameters: Datasette provides a nice interface when a named parameter is placed within a SQL query
select
bib.*
from
bib
where
indexed_subjects like '%'
|| :subject
|| '%'
# Datasette URI construction
scheme = "https://"
host = "ilsweb.cincinnatilibrary.org"
# path contains the path of the Datasette instance,
# and the name of the database
path = "/collection-analysis/current_collection"
canned_query_path = "/item_lookup_by_barcode"
response_format = '' # '' or '.csv' or '.json'
query_parameter = "?barcode="
query_parameter_value = "A000036107985"
full_request_uri = scheme + host \
+ path + canned_query_path + response_format \
+ query_parameter + query_parameter_value
Thanks, and please, let me know if you come up with any cool queries or ❤️ Datasette as much as I do!
Ray Voelker
ray.voelker@gmail.com
ray.voelker@cincinnatilibrary.org