-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Rename default datasource #1941
Rename default datasource #1941
Conversation
When looking in the documentation for experimental features (For example using DB native types) you need to add a previewFeatures flag to the Generate block, and then in the docs they use `@db.*` everywhere. So as an example if you'd want to use the Postgres native Date field you get something like this: `createdAt DateTime @default(now()) @db.Date` Since we use `DS`as a default datasource it can trip users up a bit since `@DS.Date` is not a valid Prisma line (Somehow they don't like the uppercase datasource). So if we would already rename it to `datasource db {}` we would make it easier for users in the future
Ok, so this would be a non-breaking change we'd suggest people update via manual code mod. Also, we'd need to:
@peterp anything else you can think of that we should consider along with this one? Such a small change. But, you know, Prisma always has me nervous. @jvanbaarsen Based on feedback and recommendations regarding my questions above, I can help if/as needed. Would be great to get it all in with this PR. |
This is literally the first time I've ever noticed that the datasource gets a name |
@thedavidprice No problem I can pick up the first and latter todo. (I believe the second one has been answered now right?) |
Not that I can think of. |
Thanks so much, @jvanbaarsen I've updated the original tasks I outlined. Recognizing I'm being a bit particular about this one, we've had so many unexpected hiccups with Prisma along the way I've learned to be thorough. I can take a stab at any of those three items as well — just don't want to lose track of them. Keep me posted as need. |
Update here: not getting this into the current release v0.28. But will pick up the effort for v0.29 starting next week. |
Update: Jeroen and I connected. He is going to be out of the loop for a while, so I am going to take lead on this PR for the final steps. |
@dac09 I don't think this is a breaking change. Will update v0.33 notes for code mod update. TBD otherwise. |
…-codegen * 'main' of github.com:redwoodjs/redwood: (54 commits) Add private methods loose explicitly (redwoodjs#2554) Custom `useAuth` pass through for `RedwoodApolloProvider` (redwoodjs#2455) Prerender all routes nested in Set with prerender prop (redwoodjs#2542) Upgrade eslint and prettier packages including formatting fixes (redwoodjs#2540) contributors updates (redwoodjs#2544) Rename default datasource (redwoodjs#1941) Add default config for Component generation (redwoodjs#1814) build(deps): bump core-js from 3.10.1 to 3.12.1 (redwoodjs#2481) upgrade babel 7.14.2 with misc babel packages (redwoodjs#2541) build(deps): bump http-proxy-middleware from 1.1.0 to 2.0.0 (redwoodjs#2536) build(deps): bump pino-pretty from 4.7.1 to 4.8.0 (redwoodjs#2534) build(deps): bump concurrently from 6.0.2 to 6.1.0 (redwoodjs#2533) build(deps-dev): bump firebase-admin from 9.7.0 to 9.8.0 (redwoodjs#2522) build(deps): bump esbuild-loader from 2.10.0 to 2.13.0 (redwoodjs#2518) build(deps): bump @graphql-tools/merge from 6.2.13 to 6.2.14 (redwoodjs#2516) updating minor dependency versions across packages (redwoodjs#2532) Add JSON headers to Function generator template (redwoodjs#2457) fixed firebase promises so that they can be caught (redwoodjs#2503) Prevent re-initialization of a Firebase app that is already initialized (redwoodjs#2504) build(deps-dev): bump magic-sdk from 2.7.0 to 4.3.0 (redwoodjs#2463) ...
When looking in the documentation for experimental features (For example
using DB native types) you need to add a previewFeatures flag to the
Generate block, and then in the docs they use
@db.*
everywhere.So as an example if you'd want to use the Postgres native Date field you
get something like this:
createdAt DateTime @default(now()) @db.Date
Since we use
DS
as a default datasource it can trip users up a bitsince
@DS.Date
is not a valid Prisma line (Somehow they don't like theuppercase datasource).
So if we would already rename it to
datasource db {}
we would make iteasier for users in the future.
As a sidenote, Prisma is using
datasource db {}
themselves in the docs as well.