From 5c353151e832c0e82383ddad1b3769940ab5e9ef Mon Sep 17 00:00:00 2001 From: Sophia Chu Date: Mon, 9 Dec 2024 12:06:57 -0800 Subject: [PATCH] include link to README in documentation --- docs/Documentation.md | 2 ++ examples/prisma_example/README.md | 9 ++++++--- examples/prisma_example/prisma/schema.prisma | 6 ++++++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/docs/Documentation.md b/docs/Documentation.md index af1b0cd1..ff2658a5 100644 --- a/docs/Documentation.md +++ b/docs/Documentation.md @@ -31,3 +31,5 @@ - [Plugin Service](../docs/development-guide/PluginService.md) - [Pipelines](../docs/development-guide/Pipelines.md) - [Read-Write Splitting Plugin Performance Results](../docs/development-guide/ReadWriteSplittingPerformanceResults.md) + - Using The NodeJS Wrapper with an ORM + - [Prisma Example](./../examples/prisma_example/README.md) diff --git a/examples/prisma_example/README.md b/examples/prisma_example/README.md index 2cd0f69a..999b0927 100644 --- a/examples/prisma_example/README.md +++ b/examples/prisma_example/README.md @@ -2,7 +2,8 @@ In this tutorial, you will set up a Prisma application with the AWS Advanced NodeJS Wrapper, and use the Prisma client to execute a simple database operation. -> [!NOTE] This tutorial was written for a PostgreSQL datasource using the following technologies: +> [!NOTE] +> This tutorial was written for a PostgreSQL datasource using the following technologies: > > - Prisma 6.0.1 > - AWS Advanced NodeJS Driver 1.0.0 @@ -45,7 +46,8 @@ Your Prisma project should have the following project hierarchy: └───index.ts ``` -> [!NOTE] The adapter directory will contain all the files that you will need in Step 4. For simplicity, the diagram above only shows the files that either need to be added or require modifications. +> [!NOTE] +> The adapter directory will contain all the files that you will need in Step 4. For simplicity, the diagram above only shows the files that either need to be added or require modifications. ## Step 2: Add the required dependencies @@ -88,7 +90,8 @@ Set up an AwsPgClient that connects to your database instance. Details can be fo To configure Prisma to use the datasource specified in the AwsPgClient, you will need a [driver adapter](https://www.prisma.io/docs/orm/overview/databases/database-drivers). Under the adapter directory of this tutorial is a partially implemented adapter that supports simple queries. -> [!NOTE] This adapter is modeled after Prisma's [adapter-pg](https://github.com/prisma/prisma/tree/main/packages/adapter-pg). For full functionality, the adapter files in this tutorial may need to be adjusted or customized. +> [!NOTE] +> This adapter is modeled after Prisma's [adapter-pg](https://github.com/prisma/prisma/tree/main/packages/adapter-pg). For full functionality, the adapter files in this tutorial may need to be adjusted or customized. Since driver adapters are currently in Preview, you need to enable its feature flag on the datasource block in your Prisma schema: diff --git a/examples/prisma_example/prisma/schema.prisma b/examples/prisma_example/prisma/schema.prisma index ecd86ba2..db043990 100644 --- a/examples/prisma_example/prisma/schema.prisma +++ b/examples/prisma_example/prisma/schema.prisma @@ -22,6 +22,12 @@ datasource db { url = env("DATABASE_URL") } +model bank_test { + id Int @id + name String? @db.VarChar(40) + account_balance Int? +} + model Post { id Int @id @default(autoincrement()) title String