Skip to content

Commit 415b707

Browse files
authored
PrestoDB: make password/schema/catalog optional, fix datediff syntax (growthbook#272)
1 parent 47ae7ab commit 415b707

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

packages/back-end/src/integrations/Athena.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,7 @@ export default class Athena extends SqlIntegration {
3636
formatDate(col: string): string {
3737
return `substr(to_iso8601(${col}),0,10)`;
3838
}
39+
dateDiff(startCol: string, endCol: string) {
40+
return `date_diff('day', ${startCol}, ${endCol})`;
41+
}
3942
}

packages/back-end/src/integrations/Presto.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,7 @@ export default class Presto extends SqlIntegration {
8484
formatDate(col: string): string {
8585
return `substr(to_iso8601(${col}),0,10)`;
8686
}
87+
dateDiff(startCol: string, endCol: string) {
88+
return `date_diff('day', ${startCol}, ${endCol})`;
89+
}
8790
}

packages/front-end/components/Settings/PrestoForm.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ const PrestoForm: FC<{
7272
type="text"
7373
className="form-control"
7474
name="password"
75-
required={!existing}
7675
value={params.password || ""}
7776
onChange={onParamChange}
7877
placeholder={existing ? "(Keep existing)" : ""}
@@ -84,7 +83,6 @@ const PrestoForm: FC<{
8483
type="text"
8584
className="form-control"
8685
name="catalog"
87-
required
8886
value={params.catalog || ""}
8987
onChange={onParamChange}
9088
/>
@@ -95,7 +93,6 @@ const PrestoForm: FC<{
9593
type="text"
9694
className="form-control"
9795
name="schema"
98-
required
9996
value={params.schema || ""}
10097
onChange={onParamChange}
10198
/>

0 commit comments

Comments
 (0)