diff --git a/cSpell.json b/cSpell.json index 3dbbc5aad4..3f7734f70c 100644 --- a/cSpell.json +++ b/cSpell.json @@ -78,7 +78,9 @@ "Zenstack", "Streamdal", "leaderboard", - "typesense" + "typesense", + "Solidstart", + "Astro" ], "ignoreWords": [ "Ania", diff --git a/content/100-getting-started/01-quickstart.mdx b/content/100-getting-started/01-quickstart.mdx index 797c9d44dd..c0c0219dc2 100644 --- a/content/100-getting-started/01-quickstart.mdx +++ b/content/100-getting-started/01-quickstart.mdx @@ -427,6 +427,33 @@ If you want to move forward with Prisma ORM using your own PostgreSQL, MySQL, Mo Check out the [`prisma-examples`](https://github.com/prisma/prisma-examples/) repository on GitHub to see how Prisma ORM can be used with your favorite library. The repo contains examples with Express, NestJS, GraphQL as well as fullstack examples with Next.js and Vue.js, and a lot more. +### Build real-time apps with Prisma Pulse + +[Prisma Pulse](/pulse) enables you to create applications that instantly react to changes in your database, allowing you to build type-safe real-time features and applications easily: + +| Demo | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| [`starter`](https://github.com/prisma/prisma-examples/tree/latest/pulse/starter) | A Prisma Pulse starter app | +| [`email-with-resend`](https://github.com/prisma/prisma-examples/tree/latest/pulse/email-with-resend) | An example app to send emails to new users using Prisma Pulse and Resend | +| [`fullstack-leaderboard`](https://github.com/prisma/prisma-examples/tree/latest/pulse/fullstack-leaderboard) | A live leaderboard (built with Next.js) | +| [`fullstack-simple-chat`](https://github.com/prisma/prisma-examples/tree/latest/pulse/fullstack-simple-chat) | A simple chat app (built with Next.js & Express) | +| [`product-search-with-typesense`](https://github.com/prisma/prisma-examples/tree/latest/pulse/product-search-with-typesense) | A cron job that syncs data into Typesense (built with Hono.js) | +| [`data-sync-with-bigquery`](https://github.com/prisma/prisma-examples/tree/latest/pulse/data-sync-with-bigquery) | A script that automatically syncs data into Google BigQuery | + +### Speed up your database queries with Prisma Accelerate + +[Prisma Accelerate](/accelerate) is a connection pooler and global database cache that can drastically speed up your database queries. Check out the [Speed Test](https://accelerate-speed-test.prisma.io/) or try Accelerate with your favorite framework: + +| Demo | Description | +| ----------------------------------------------- | -------------------------------------------------------------------------- | +| [`nextjs-starter`](./accelerate/nextjs-starter) | A Next.js project using Prisma Accelerate's caching and connection pooling | +| [`svelte-starter`](./accelerate/svelte-starter/) | A SvelteKit project using Prisma Accelerate's caching and connection pooling | +| [`solidstart-starter`](./accelerate/solidstart-starter/) | A Solidstart project using Prisma Accelerate's caching and connection pooling | +| [`remix-starter`](./accelerate/remix-starter/) | A Remix project using Prisma Accelerate's caching and connection pooling | +| [`nuxt-starter`](./accelerate/nuxtjs-starter/) | A Nuxt.js project using Prisma Accelerate's caching and connection pooling | +| [`astro-starter`](./accelerate/astro-starter/) | An Astro project using Prisma Accelerate's caching and connection pooling | + + ### Build an app with Prisma ORM The Prisma blog features comprehensive tutorials about Prisma ORM, check out our latest ones: diff --git a/content/100-getting-started/index.mdx b/content/100-getting-started/index.mdx index e68c7301ca..654c58c605 100644 --- a/content/100-getting-started/index.mdx +++ b/content/100-getting-started/index.mdx @@ -33,9 +33,10 @@ Explore our products that make it easy to build and scale data-driven applicatio [**Prisma ORM**](/orm/overview/introduction/what-is-prisma) is a next-generation Node.js and TypeScript ORM that unlocks a new level of developer experience when working with databases thanks to its intuitive data model, automated migrations, type-safety & auto-completion. -[**Prisma Accelerate**](/accelerate/what-is-accelerate) is a global database cache with scalable connection pooling to make your queries fast. +[**Prisma Accelerate**](/accelerate) is a global database cache with scalable connection pooling to make your queries fast. + +[**Prisma Pulse**](/pulse) allows you to react to database changes with type-safe model streams in real-time. -[**Prisma Pulse**](/pulse/what-is-pulse) allows you to react to database changes with type-safe model subscriptions. diff --git a/content/200-orm/200-prisma-client/300-client-extensions/200-extension-examples.mdx b/content/200-orm/200-prisma-client/300-client-extensions/200-extension-examples.mdx index 76cc926c50..67312e33b8 100644 --- a/content/200-orm/200-prisma-client/300-client-extensions/200-extension-examples.mdx +++ b/content/200-orm/200-prisma-client/300-client-extensions/200-extension-examples.mdx @@ -29,6 +29,7 @@ The following is a list of extensions created by the community. If you want to c | [`prisma-extension-random`](https://github.com/nkeil/prisma-extension-random) | Lets you query for random rows in your database | | [`prisma-paginate`](https://github.com/sandrewTx08/prisma-paginate) | Adds support for paginating read queries | | [`prisma-extension-streamdal`](https://github.com/streamdal/prisma-extension-streamdal) | Adds support for Code-Native data pipelines using Streamdal | +| [`prisma-rbac`](https://github.com/multipliedtwice/prisma-rbac) | Adds customizable role-based access control | If you have built an extension and would like to see it featured, feel free to add it to the list by opening a pull request. diff --git a/content/300-accelerate/100-what-is-accelerate.mdx b/content/300-accelerate/100-what-is-accelerate.mdx deleted file mode 100644 index 44cecf7e0a..0000000000 --- a/content/300-accelerate/100-what-is-accelerate.mdx +++ /dev/null @@ -1,29 +0,0 @@ ---- -title: 'What is Accelerate' -metaTitle: 'What is Accelerate' -metaDescription: 'Learn about Accelerate, a global cache and serverless connection pool that makes your database queries faster.' -tocDepth: 3 -toc: true ---- - - - -[Prisma Accelerate](https://www.prisma.io/data-platform/accelerate) is a global database cache available in 300 locations that you can use to achieve up to 1000x faster database queries. - -Its main features are: - -- a global cache -- scalable connection pool for serverless and edge applications -- usage of Prisma Client at the edge (e.g. in Cloudflare Workers or Vercel Edge Functions) - -The goal of Accelerate is to improve response times and reduce database load. It works by caching data at the edge using established caching patterns that you control. - -While Accelerate is beneficial for all types of applications, being at the edge provides additional benefits to edge function environments like [Vercel Edge Functions](https://vercel.com/docs/concepts/functions/edge-functions), [Cloudflare Workers](https://workers.cloudflare.com/), and [Deno Deploy](https://deno.com/deploy). Cache hits can be served from data centers near the user regardless of the region of the database. - - - -## See Accelerate in action - -We built a small sample application, [Accelerate Speed Test](https://accelerate-speed-test.prisma.io/). The app compares the performance of cached and uncached queries side by side. The app is [open source](https://github.com/prisma/accelerate-speed-test) and you can clone it to try it yourself. - -![Screenshot of the Accelerate Speed Test app showing cached query performance](/img/accelerate/accelerate.png) diff --git a/content/300-accelerate/800-examples.mdx b/content/300-accelerate/800-examples.mdx new file mode 100644 index 0000000000..8c4b731ff4 --- /dev/null +++ b/content/300-accelerate/800-examples.mdx @@ -0,0 +1,21 @@ +--- +title: 'Examples' +metaTitle: 'Prisma Accelerate: Examples' +metaDescription: 'Check out ready-to-run examples for Prisma Accelerate.' +tocDepth: 3 +--- + +## Prisma Accelerate examples + +Here is a list of ready-to-run example projects that demonstrate how to use Prisma Accelerate: + +| Demo | Description | +| ----------------------------------------------- | -------------------------------------------------------------------------- | +| [`nextjs-starter`](./accelerate/nextjs-starter) | A Next.js project using Prisma Accelerate's caching and connection pooling | +| [`svelte-starter`](./accelerate/svelte-starter/) | A SvelteKit project using Prisma Accelerate's caching and connection pooling | +| [`solidstart-starter`](./accelerate/solidstart-starter/) | A Solidstart project using Prisma Accelerate's caching and connection pooling | +| [`remix-starter`](./accelerate/remix-starter/) | A Remix project using Prisma Accelerate's caching and connection pooling | +| [`nuxt-starter`](./accelerate/nuxtjs-starter/) | A Nuxt.js project using Prisma Accelerate's caching and connection pooling | +| [`astro-starter`](./accelerate/astro-starter/) | An Astro project using Prisma Accelerate's caching and connection pooling | + + diff --git a/content/300-accelerate/index.mdx b/content/300-accelerate/index.mdx index 8dfbc78e41..f1f698042d 100644 --- a/content/300-accelerate/index.mdx +++ b/content/300-accelerate/index.mdx @@ -4,8 +4,7 @@ metaTitle: 'Prisma Accelerate' metaDescription: 'Prisma Accelerate is a global database cache with built-in connection pooling that helps improve database performance in Serverless and Edge applications.' sidebar_position: 0 hide_table_of_contents: false -pagination_next: 'accelerate/what-is-accelerate' - +pagination_next: 'accelerate/getting-started' --- import { @@ -27,7 +26,15 @@ import { Prisma Accelerate -[Prisma Accelerate](https://www.prisma.io/data-platform/accelerate) is a managed connection pooler with global caching that helps speed up database queries. With Accelerate, you can easily configure connection pooling and choose the right cache strategy for your app. +[Prisma Accelerate](https://www.prisma.io/data-platform/accelerate) is a fully managed global connection pool and caching layer for your existing database, enabling query-level cache policies directly from the Prisma ORM. + +With 15+ global regions, the connection pool scales your app for a global audience, particularly for serverless deployments that risk connection timeouts during peak times. + +Accelerate’s global cache, hosted in 300+ locations, ensures a fast experience for users, regardless of your database’s location. + +You can configure query-level caching strategies directly in your code with Prisma ORM, making setup and tuning easy. + +Together, the connection pool and cache allow you to scale effortlessly and handle traffic spikes without infrastructure concerns. - You can submit any feedback about Prisma Pulse in the `#help-and-questions` channel in our community [Discord](https://pris.ly/discord). - - diff --git a/content/400-pulse/800-examples.mdx b/content/400-pulse/800-examples.mdx new file mode 100644 index 0000000000..9739bbe73b --- /dev/null +++ b/content/400-pulse/800-examples.mdx @@ -0,0 +1,20 @@ +--- +title: 'Examples' +metaTitle: 'Prisma Pulse: Examples' +metaDescription: 'Check out ready-to-run examples for Prisma Pulse.' +tocDepth: 3 +--- + +## Prisma Pulse examples + +Here is a list of ready-to-run example projects that demonstrate how to use Prisma Pulse to build real-time applications: + +| Demo | Description | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| [`starter`](https://github.com/prisma/prisma-examples/tree/latest/pulse/starter) | A Prisma Pulse starter app | +| [`email-with-resend`](https://github.com/prisma/prisma-examples/tree/latest/pulse/email-with-resend) | An example app to send emails to new users using Prisma Pulse and Resend | +| [`fullstack-leaderboard`](https://github.com/prisma/prisma-examples/tree/latest/pulse/fullstack-leaderboard) | A live leaderboard (built with Next.js) | +| [`fullstack-simple-chat`](https://github.com/prisma/prisma-examples/tree/latest/pulse/fullstack-simple-chat) | A simple chat app (built with Next.js & Express) | +| [`product-search-with-typesense`](https://github.com/prisma/prisma-examples/tree/latest/pulse/product-search-with-typesense) | A cron job that syncs data into Typesense (built with Hono.js) | +| [`data-sync-with-bigquery`](https://github.com/prisma/prisma-examples/tree/latest/pulse/data-sync-with-bigquery) | A script that automatically syncs data into Google BigQuery | + diff --git a/content/400-pulse/index.mdx b/content/400-pulse/index.mdx index d4afdaf809..ed8fe580c2 100644 --- a/content/400-pulse/index.mdx +++ b/content/400-pulse/index.mdx @@ -3,8 +3,7 @@ title: '' metaTitle: 'Prisma Pulse' metaDescription: 'Prisma Pulse enables real-time database events with type-safe Prisma Client subscriptions.' sidebar_position: 0 -pagination_next: 'pulse/what-is-pulse' - +pagination_next: 'pulse/getting-started' --- import { @@ -27,7 +26,13 @@ import { Prisma Pulse -[Prisma Pulse](https://www.prisma.io/data-platform/pulse) lets you subscribe to any changes in your database easily and in a type-safe way using Prisma Client, enabling you to trigger events and actions in real-time. +[Prisma Pulse](https://www.prisma.io/data-platform/pulse) lets you build reactive, event-driven applications with your serverless backend, connecting seamlessly to your existing PostgreSQL database. With just a few lines of code, you can react to database changes in real-time. + +This enables real-time tasks like sending welcome emails when a user signs up or simplifying complex batch jobs. + +Pulse offers an alternative to traditional backend systems built with queues or scheduled batch jobs, eliminating the need for hosting, management, and maintenance. + +Pulse provides a simple alternative using the idea of unidirectional data flow (via the [Change Data Capture](https://en.wikipedia.org/wiki/Change_data_capture) pattern). It also integrates seamlessly with Prisma ORM and lets you subscribe to any database change events directly via Prisma Client. { link: "https://pris.ly/sidebar-promo/sql-queries-in-orm", color: "teal", }, + { + text: `Tell us how Prisma ORM is working for you!`, + link: "https://pris.ly/orm-survey-5-18", + color: "indigo", + }, ]; let promo = promoOptions[Math.floor(Math.random() * promoOptions.length)]; diff --git a/src/css/custom.css b/src/css/custom.css index dc938f5ffa..3e1afe2ce3 100644 --- a/src/css/custom.css +++ b/src/css/custom.css @@ -1097,6 +1097,7 @@ hr { justify-content: space-between; align-items: start; flex-direction: column; + margin-bottom: 2rem; } @media (min-width: 996px) { diff --git a/src/css/docsearch.css b/src/css/docsearch.css index 79a2f4611c..552436c0f8 100644 --- a/src/css/docsearch.css +++ b/src/css/docsearch.css @@ -14,6 +14,11 @@ color: rgb(49, 130, 206) !important; } +.DocSearch-Cancel { + --docsearch-highlight-color: var(--ifm-font-color-base); + margin: auto 0; +} + .DocSearch-HitsFooter > a { display: none; } @@ -91,7 +96,7 @@ html[data-theme="dark"] { /* Modal */ --docsearch-modal-background: #090a15; /* Search box */ - --docsearch-searchbox-background: var(--ifm-background-color); + --docsearch-searchbox-background: var(--gray-900) !important; --docsearch-searchbox-focus-background: var(--gray-800) !important; /* Hit */ --docsearch-hit-color: var(--ifm-font-color-base); @@ -116,7 +121,7 @@ html[data-theme="dark"] { --docsearch-footer-shadow: 0px -4px 8px 0px #00000033, 0px 1px 0px 0px #494c6a80 inset; --docsearch-modal-shadow: 0px 3px 8px 0px #000309, 1px 1px 0px 0px #2c2e40 inset; --docsearch-muted-color: var(--gray-500); - --docsearch-searchbox-background: var(--ifm-background-color); + --docsearch-searchbox-background: var(--gray-900) !important; --docsearch-key-shadow: inset 0 -2px 0 0 #282d55, inset 0 0 1px 1px #51577d, 0 2px 2px 0 rgba(3, 4, 9, 0.3); diff --git a/src/css/theming.css b/src/css/theming.css index c5b693dcfd..2143d7e182 100644 --- a/src/css/theming.css +++ b/src/css/theming.css @@ -5,6 +5,7 @@ } :root { + --docsearch-searchbox-background: var(--ifm-color-secondary); --docsearch-modal-width: 1248px; --ifm-color-primary: #2e8555; --ifm-color-primary-dark: #29784c; @@ -159,6 +160,7 @@ /* For readability concerns, you should choose a lighter palette in dark mode. */ /* PRIMITES WITH THEME DEFINED BY TOGGLER */ html[data-theme="dark"] { + --docsearch-searchbox-background: var(--gray-900) !important; --ifm-blockquote-border-color: transparent; --ifm-color-primary: #25c2a0; --ifm-color-primary-dark: #21af90; @@ -193,7 +195,7 @@ html[data-theme="dark"] { --orm-card-bg: var(--gray-900); --grid-border-color: var(--gray-700); --community-bgd-color: var(--gray-900); - --shadow-card-bg: var(--gray-900); + --shadow-card-bg: var(--gray-1000); --badge-color: rgb(247, 250, 252); --badge-bg-color: rgb(45, 55, 72); --ifm-card-background-color: var(--gray-900); @@ -206,7 +208,7 @@ html[data-theme="dark"] { --selection-bgd-color: #0c344b; --white-color: #ffffff; --link-color: #3182ce; - --code-bgd-color: #2d3748; + --code-bgd-color: #1A202C; --code-inline-bgd-color: #2d3748; --list-bullet-color: #a0aec0; --search-highlight-bg-color: #ebf8ff; @@ -251,6 +253,7 @@ html[data-theme="dark"] { @media (prefers-color-scheme: dark) { /* Theme: Dark OS + Light docs = Light docs */ :root[data-theme="light"] { + --docsearch-searchbox-background: var(--ifm-color-secondary); --ifm-color-primary: #2e8555; --ifm-background-color: #fff; --ifm-color-primary-dark: #29784c; @@ -377,6 +380,7 @@ html[data-theme="dark"] { } :root[data-theme="dark"] { + --docsearch-searchbox-background: var(--gray-900) !important; --ifm-color-primary: #25c2a0; --ifm-color-primary-dark: #21af90; --ifm-color-primary-darker: #1fa588; @@ -410,7 +414,7 @@ html[data-theme="dark"] { --orm-card-bg: var(--gray-900); --grid-border-color: var(--gray-700); --community-bgd-color: var(--gray-900); - --shadow-card-bg: var(--gray-900); + --shadow-card-bg: var(--gray-1000); --badge-color: rgb(247, 250, 252); --badge-bg-color: rgb(45, 55, 72); --code-bg: #1a202c; @@ -423,7 +427,7 @@ html[data-theme="dark"] { --white-color: #ffffff; --link-color: #3182ce; --ifm-link-hover-color: #5196d7; - --code-bgd-color: #2d3748; + --code-bgd-color: #1A202C; --code-inline-bgd-color: #2d3748; --list-bullet-color: #a0aec0; --search-highlight-bg-color: #ebf8ff; diff --git a/src/data/indexData.ts b/src/data/indexData.ts index ef62203f13..aceffaafc2 100644 --- a/src/data/indexData.ts +++ b/src/data/indexData.ts @@ -23,11 +23,11 @@ export const ProductLinkData = { "Expand your application capabilities with global database caching, connection pooling, and real-time database subscriptions.", links: [ { - url: "/accelerate/what-is-accelerate", + url: "/accelerate", title: "Prisma Accelerate", }, { - url: "/pulse/what-is-pulse", + url: "/pulse", title: "Prisma Pulse", }, ], diff --git a/src/theme/CodeBlock/Line/styles.module.scss b/src/theme/CodeBlock/Line/styles.module.scss index c7780abe70..66280cafcf 100644 --- a/src/theme/CodeBlock/Line/styles.module.scss +++ b/src/theme/CodeBlock/Line/styles.module.scss @@ -84,6 +84,6 @@ the background in custom CSS file due bug https://github.com/facebook/docusaurus .highlightedNumbers { margin: 0 !important; .codeHighlighted { - margin-left: var(--ifm-pre-padding); + margin-left: calc(var(--ifm-pre-padding) + 8.41px); } } diff --git a/src/theme/Footer/Layout/index.tsx b/src/theme/Footer/Layout/index.tsx index 1c8e8e5724..6f0f0ceb88 100644 --- a/src/theme/Footer/Layout/index.tsx +++ b/src/theme/Footer/Layout/index.tsx @@ -27,8 +27,10 @@ export default function FooterLayout({ style, links, logo, copyright }) { hipaa - {/* iso - soc */} + + iso27001 + + {/* soc */} )} diff --git a/src/theme/MDXComponents.tsx b/src/theme/MDXComponents.tsx index 65a5d8ce48..15578cc0ea 100644 --- a/src/theme/MDXComponents.tsx +++ b/src/theme/MDXComponents.tsx @@ -27,14 +27,14 @@ const TopBlock: React.FC = ({ const location = useLocation(); return ( <> -
+ {(langSwitcher || dbSwitcher) &&
-
+
} {children} ); @@ -44,9 +44,10 @@ const TopBlock: React.FC = ({ const CodeWithResult: React.FC<{ children: React.ReactElement[] }> = ({ children, outputResultText, + expanded = false, ...rest }: any) => { - const [show, setShow] = useState(false); + const [show, setShow] = useState(expanded); return (
{children[0]}
diff --git a/static/_redirects b/static/_redirects index a6284385cc..91e084017a 100644 --- a/static/_redirects +++ b/static/_redirects @@ -511,7 +511,7 @@ /concepts/overview/prisma-in-your-stack/graphql /docs/orm/overview/prisma-in-your-stack/graphql /concepts/overview/prisma-in-your-stack/rest /docs/orm/overview/prisma-in-your-stack/rest /accelerate/concepts /docs/accelerate -/data-platform/accelerate/concepts /docs/accelerate/what-is-accelerate +/data-platform/accelerate/concepts /docs/accelerate /data-platform/accelerate/concepts#stale-while-revalidate-swr /docs/accelerate/caching#stale-while-revalidate-swr /data-platform/accelerate/concepts#time-to-live-ttl /docs/accelerate/caching#time-to-live-ttl /data-platform/accelerate/concepts#cache-strategies /docs/accelerate/caching#cache-strategies @@ -528,10 +528,11 @@ /platform/concepts/projects /docs/platform/about#project /platform/concepts/environments /docs/platform/about#environment /platform/concepts /docs/platform/about -/pulse/concepts /docs/pulse/what-is-pulse +/pulse/concepts /docs/pulse /more/roadmap /docs/orm/more/releases#roadmap /orm/overview/going-beyond /docs/orm/overview/beyond-prisma-orm -/pulse/faq#how-to-configure-tsconfigjson-with-the-pulse-extension /docs/pulse/faq#how-do-i-import-the-pulse-client-extension-when-using-moduleresolutionbundler-in-my-tsconfigjson +/accelerate/what-is-accelerate /docs/accelerate/ +/pulse/what-is-pulse /docs/pulse/ ### Dynamic redirects ### /faq/* https://v1.prisma.io/docs/1.34/faq/:splat @@ -577,3 +578,5 @@ /getting-started/setup-prisma/start-from-scratch/mongodb/next-steps-* /docs/getting-started/setup-prisma/start-from-scratch/mongodb/next-steps /getting-started/setup-prisma/add-to-existing-project/relational-databases/next-steps-* /docs/getting-started/setup-prisma/add-to-existing-project/relational-databases/next-steps /getting-started/setup-prisma/add-to-existing-project/mongodb/next-steps-* /docs/getting-started/setup-prisma/add-to-existing-project/mongodb/next-steps + +