Skip to content

Commit

Permalink
Merge pull request #95 from palantir/ssanjay/dateTimeFilter
Browse files Browse the repository at this point in the history
Fix datetime where clause
  • Loading branch information
ssanjay1 authored Feb 27, 2024
2 parents b1584b3 + 1943a47 commit 39c0324
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/client/changelog/@unreleased/pr-95.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
type: feature
feature:
description: Fix datetime where clause
links:
- https://github.com/palantir/osdk-ts/pull/95
5 changes: 5 additions & 0 deletions packages/client/src/query/WhereClause.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ type NumberFilter =
| BaseFilter<number>
| MakeFilter<"$gt" | "$gte" | "$lt" | "$lte", number>;

type DatetimeFilter =
| BaseFilter<string>
| MakeFilter<"$gt" | "$gte" | "$lt" | "$lte", string>;

export const DistanceUnitMapping = {
"centimeter": "CENTIMETERS",
"centimeters": "CENTIMETERS",
Expand Down Expand Up @@ -106,6 +110,7 @@ export type GeoFilter = GeoFilter_Within | GeoFilter_Intersects;
type FilterFor<PD extends ObjectTypePropertyDefinition> = PD["type"] extends
"string" ? StringFilter
: PD["type"] extends "geopoint" | "geoshape" ? GeoFilter
: PD["type"] extends "datetime" | "timestamp" ? DatetimeFilter
: NumberFilter; // FIXME we need to represent all types

export interface AndWhereClause<
Expand Down

0 comments on commit 39c0324

Please sign in to comment.