-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Tinybird migration #2924
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Tinybird migration #2924
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
0844d2b
Tinybird migration
steven-tey e2b7a6f
simplify recordLink
steven-tey 10c0056
Merge branch 'main' into tb-migration
steven-tey 5383d50
Update record-click.ts
steven-tey 894fd79
Merge branch 'main' into tb-migration
steven-tey da3d0de
stash
steven-tey baf4b3d
Merge branch 'main' into tb-migration
steven-tey b0db895
Merge branch 'tb-migration' of https://github.com/dubinc/dub into tb-…
steven-tey 769ac70
Merge branch 'main' into tb-migration
steven-tey ebd5d5b
Merge branch 'main' into tb-migration
steven-tey 690fd63
Merge branch 'main' into tb-migration
steven-tey File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,19 @@ | ||
| import { waitUntil } from "@vercel/functions"; | ||
| import { importErrorLogSchema } from "../zod/schemas/import-error-log"; | ||
| import { tb } from "./client"; | ||
| import { tb, tbNew } from "./client"; | ||
|
|
||
| export const logImportError = tb.buildIngestEndpoint({ | ||
| export const logImportErrorTB = tb.buildIngestEndpoint({ | ||
| datasource: "dub_import_error_logs", | ||
| event: importErrorLogSchema, | ||
| }); | ||
|
|
||
| // TODO: Remove after Tinybird migration | ||
| export const logImportErrorTBNew = tbNew.buildIngestEndpoint({ | ||
| datasource: "dub_import_error_logs", | ||
| event: importErrorLogSchema, | ||
| }); | ||
|
|
||
| export const logImportError = async (payload: any) => { | ||
| waitUntil(logImportErrorTBNew(payload)); | ||
| return await logImportErrorTB(payload); | ||
steven-tey marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,21 +1,39 @@ | ||
| import { waitUntil } from "@vercel/functions"; | ||
| import { z } from "zod"; | ||
| import { leadEventSchemaTB } from "../zod/schemas/leads"; | ||
| import { tb } from "./client"; | ||
| import { tb, tbNew } from "./client"; | ||
|
|
||
| export const recordLead = tb.buildIngestEndpoint({ | ||
| export const recordLeadTB = tb.buildIngestEndpoint({ | ||
| datasource: "dub_lead_events", | ||
| event: leadEventSchemaTB, | ||
| }); | ||
|
|
||
| export const recordLeadSync = tb.buildIngestEndpoint({ | ||
| // TODO: Remove after Tinybird migration | ||
| export const recordLeadTBNew = tbNew.buildIngestEndpoint({ | ||
| datasource: "dub_lead_events", | ||
| event: leadEventSchemaTB, | ||
| wait: true, | ||
| }); | ||
|
|
||
| export const recordLeadWithTimestamp = tb.buildIngestEndpoint({ | ||
| export const recordLead = async (payload: any) => { | ||
| waitUntil(recordLeadTBNew(payload)); | ||
| return await recordLeadTB(payload); | ||
| }; | ||
|
|
||
| export const recordLeadWithTimestampTB = tb.buildIngestEndpoint({ | ||
| datasource: "dub_lead_events", | ||
| event: leadEventSchemaTB.extend({ | ||
| timestamp: z.string(), | ||
| }), | ||
| }); | ||
|
|
||
| export const recordLeadWithTimestampTBNew = tbNew.buildIngestEndpoint({ | ||
| datasource: "dub_lead_events", | ||
| event: leadEventSchemaTB.extend({ | ||
| timestamp: z.string(), | ||
| }), | ||
| }); | ||
|
|
||
| export const recordLeadWithTimestamp = async (payload: any) => { | ||
| waitUntil(recordLeadWithTimestampTBNew(payload)); | ||
| return await recordLeadWithTimestampTB(payload); | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.