Skip to content

feat: Adds new customPrisma for hosted API#3055

Merged
zomars merged 4 commits intomainfrom
feat/dynamic-prisma
Jun 14, 2022
Merged

feat: Adds new customPrisma for hosted API#3055
zomars merged 4 commits intomainfrom
feat/dynamic-prisma

Conversation

@agustif
Copy link
Contributor

@agustif agustif commented Jun 13, 2022

What does this PR do?

adds a new customPrisma() in our client, that will be used for the new Hosted API funcitonality, basically allowing us to let self-hosted enterprise edition users to use the API through api.cal.com but point to their backend/database.

This will be done passing a custom datasource db connection string in API.
customPrisma({ datasources: { db: { url: credentials } } }),

@vercel
Copy link

vercel bot commented Jun 13, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
cal ✅ Ready (Inspect) Visit Preview Jun 14, 2022 at 5:11PM (UTC)
swagger ✅ Ready (Inspect) Visit Preview Jun 14, 2022 at 5:11PM (UTC)
2 Ignored Deployments
Name Status Preview Updated
docs ⬜️ Ignored (Inspect) Jun 14, 2022 at 5:11PM (UTC)
ui ⬜️ Ignored (Inspect) Jun 14, 2022 at 5:11PM (UTC)

@agustif agustif requested a review from zomars June 13, 2022 22:29
@agustif agustif changed the title Feat/dynamic prisma Hosted API: Adds new customPrisma for hosted API Jun 13, 2022
@agustif agustif changed the title Hosted API: Adds new customPrisma for hosted API feat: Adds new customPrisma for hosted API Jun 13, 2022
export const HOSTED_CAL_FEATURES = process.env.HOSTED_CAL_FEATURES || BASE_URL === "https://app.cal.com";
/** @deprecated use `WEBAPP_URL` */
export const NEXT_PUBLIC_BASE_URL = process.env.NEXT_PUBLIC_WEBAPP_URL || `https://${process.env.VERCEL_URL}`;
export const PRISMA_CLIENT_CACHING_TIME = 1000 * 60 * 60 * 24;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's keep this in the API

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, will move to @calcom/api/lib/constants.ts

Copy link
Contributor

@zomars zomars left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpicks

@agustif agustif added the ♻️ autoupdate tells kodiak to keep this branch up-to-date label Jun 14, 2022
@zomars zomars enabled auto-merge (squash) June 14, 2022 17:04
@zomars zomars merged commit 22460a4 into main Jun 14, 2022
@zomars zomars deleted the feat/dynamic-prisma branch June 14, 2022 17:11
@zomars zomars mentioned this pull request Jun 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

♻️ autoupdate tells kodiak to keep this branch up-to-date

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants