Skip to content

graphdl/clickhouse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@graphdl/clickhouse

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 }))

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published