import { sql } from '@graphdl/clickhouse'
api
.get('/:vin/values', ({ vin }) => sql` SELECT * FROM values WHERE vin = ${vin: String} `({ vin }))
.get('/:vin/listings', ({ vin, query: { limit = 100, offset = 0} }) => sql`
SELECT
*,
min(date) as firstSeen,
max(date) as lastSeen,
min(price) as minPrice,
max(price) as maxPrice,
avg(price) as avgPrice,
min(mileage) as minMileage,
max(mileage) as maxMileage,
avg(mileage) as avgMileage,
count(*) as count
FROM listings
WHERE vin = {vin: String = WP0AF2A99KS165242}
GROUP BY vin
LIMIT {limit: Number}
OFFSET {offset: Number}
`({ vin, limit, offset }))
-
Notifications
You must be signed in to change notification settings - Fork 0
License
graphdl/clickhouse
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
No description, website, or topics provided.
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published