Skip to content

Commit 4fb564d

Browse files
committed
Fix Prisma usage
1 parent 4dbc513 commit 4fb564d

File tree

123 files changed

+3896
-2863
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

123 files changed

+3896
-2863
lines changed

Diff for: README.md

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ Here is an overview of all data service providers and the compute locations avai
1919
| PlanetScale w/ Kysely ||||
2020
| PlanetScale w/ Prisma ORM ||||
2121
| PlanetScale w/ Drizzle ||||
22-
| PolyScale ||||
2322
| Shopify (Storefront GraphQL API) ||||
2423
| Supabase w/ supabase-js ||||
2524
| Supabase w/ Prisma ORM ||||

Diff for: package.json

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"private": true,
33
"scripts": {
4-
"dev": "next dev",
4+
"dev": "next dev --turbopack",
55
"build": "next build",
66
"start": "next start",
77
"gen:planetscale": "prisma generate --schema ./prisma-planetscale/schema.prisma",
@@ -17,7 +17,6 @@
1717
"@libsql/client": "^0.14.0",
1818
"@neondatabase/serverless": "^0.10.4",
1919
"@planetscale/database": "^1.19.0",
20-
"@polyscale/serverless-js": "^1.4.0",
2120
"@prisma/adapter-libsql": "^6.0.1",
2221
"@prisma/adapter-neon": "^6.0.1",
2322
"@prisma/adapter-planetscale": "^6.0.1",
@@ -37,7 +36,7 @@
3736
"kysely": "^0.27.4",
3837
"kysely-planetscale": "^1.5.0",
3938
"mysql2": "^3.11.5",
40-
"next": "15.0.4",
39+
"next": "15.1.6",
4140
"postcss": "^8.4.49",
4241
"postgres": "^3.4.5",
4342
"prisma": "^6.0.1",

Diff for: pages/api/neon-prisma-global.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { NextRequest as Request, NextResponse as Response } from 'next/server';
22
import { neon } from '@neondatabase/serverless';
33
import { PrismaNeonHTTP } from '@prisma/adapter-neon';
4-
import { PrismaClient } from '@prisma/client';
4+
import { PrismaClient } from '../../prisma-neon/prisma-client';
55

66
export const config = {
77
runtime: 'edge',
@@ -50,4 +50,3 @@ function toNumber(queryParam: string | null, min = 1, max = 5) {
5050
const num = Number(queryParam);
5151
return Number.isNaN(num) ? null : Math.min(Math.max(num, min), max);
5252
}
53-

Diff for: pages/api/neon-prisma-node.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { NextApiRequest, NextApiResponse } from 'next';
22
import { neon } from '@neondatabase/serverless';
33
import { PrismaNeonHTTP } from '@prisma/adapter-neon';
4-
import { PrismaClient } from '@prisma/client';
4+
import { PrismaClient } from '../../prisma-neon/prisma-client';
55

66
// Use the WebSocket connection of the Serverless Driver
77
// const pool = new Pool({ connectionString: process.env.NEON_DATABASE_URL })
@@ -38,4 +38,3 @@ function toNumber(queryParam: string | string[] | null, min = 1, max = 5) {
3838
const num = Number(queryParam);
3939
return Number.isNaN(num) ? 1 : Math.min(Math.max(num, min), max);
4040
}
41-

Diff for: pages/api/planetscale-prisma-global.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { NextRequest as Request, NextResponse as Response } from 'next/server';
2-
import { PrismaClient } from '@prisma/client';
2+
import { PrismaClient } from '../../prisma-planetscale/prisma-client';
33
import { PrismaPlanetScale } from '@prisma/adapter-planetscale';
44
import { Client } from '@planetscale/database';
55

Diff for: pages/api/planetscale-prisma-node.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { NextApiRequest, NextApiResponse } from 'next';
2-
import { PrismaClient } from '@prisma/client';
2+
import { PrismaClient } from '../../prisma-planetscale/prisma-client';
33

44
const prisma = new PrismaClient({
55
datasourceUrl: process.env.PLANETSCALE_DATABASE_URL,

Diff for: pages/api/polyscale-global.ts

-54
This file was deleted.

Diff for: pages/api/polyscale-regional.ts

-6
This file was deleted.

Diff for: pages/api/turso-prisma-global.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { NextRequest as Request, NextResponse as Response } from 'next/server';
2-
import { PrismaClient } from '@prisma/client';
2+
import { PrismaClient } from '../../prisma-turso/prisma-client';
33
import { PrismaLibSQL } from '@prisma/adapter-libsql';
44
import { createClient } from '@libsql/client/web';
55

Diff for: pages/api/turso-prisma-node.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { NextApiRequest, NextApiResponse } from 'next';
2-
import { PrismaClient } from '@prisma/client';
2+
import { PrismaClient } from '../../prisma-turso/prisma-client';
33
import { PrismaLibSQL } from '@prisma/adapter-libsql';
44
import { createClient } from '@libsql/client';
55

Diff for: pages/index.tsx

+6-74
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ import Head from 'next/head';
1010
import GithubCorner from '@/components/github-corner';
1111

1212
const NODE_AVAILABLE = [
13-
'planetscale-drizzle',
14-
'planetscale-prisma',
13+
,
1514
'convex',
1615
'xata-sdk',
1716
'grafbase',
@@ -53,7 +52,7 @@ export default function Page() {
5352
try {
5453
const start = Date.now();
5554
const res = await fetch(
56-
`/api/${dataService}-${type}?count=${queryCount}`
55+
`/api/${dataService}-${type}?count=${queryCount}`,
5756
);
5857
const data = await res.json();
5958
const end = Date.now();
@@ -66,7 +65,7 @@ export default function Page() {
6665
return null;
6766
}
6867
},
69-
[]
68+
[],
7069
);
7170

7271
const onRunTest = useCallback(async () => {
@@ -171,7 +170,7 @@ export default function Page() {
171170
setShouldTestGlobal(!NODE_ONLY.includes(v));
172171
setShouldTestRegional(!NODE_ONLY.includes(v));
173172
setShouldTestNode(
174-
NODE_ONLY.includes(v) || NODE_AVAILABLE.includes(v)
173+
NODE_ONLY.includes(v) || NODE_AVAILABLE.includes(v),
175174
);
176175
setDataService(v);
177176
}}
@@ -206,7 +205,7 @@ export default function Page() {
206205
>
207206
Neon (w/ Prisma ORM)
208207
</SelectItem>
209-
<SelectItem
208+
{/* <SelectItem
210209
data-testid="planetscale"
211210
value="planetscale"
212211
icon={CircleStackIcon}
@@ -226,14 +225,7 @@ export default function Page() {
226225
icon={CircleStackIcon}
227226
>
228227
PlanetScale (w/ Drizzle ORM)
229-
</SelectItem>
230-
<SelectItem
231-
data-testid="polyscale"
232-
value="polyscale"
233-
icon={PolyScaleIcon}
234-
>
235-
PolyScale (@polyscale/serverless-js driver)
236-
</SelectItem>
228+
</SelectItem> */}
237229
<SelectItem
238230
data-testid="shopify"
239231
value="shopify"
@@ -736,66 +728,6 @@ function TursoIcon() {
736728
);
737729
}
738730

739-
function PolyScaleIcon() {
740-
return (
741-
<svg
742-
width="24"
743-
height="24"
744-
viewBox="0 0 61 60"
745-
className="flex-none h-5 w-5 mr-3"
746-
version="1.1"
747-
xmlns="http://www.w3.org/2000/svg"
748-
style={{
749-
fillRule: 'evenodd',
750-
clipRule: 'evenodd',
751-
strokeLinejoin: 'round',
752-
strokeMiterlimit: 2,
753-
}}
754-
>
755-
<rect
756-
id="ArtBoard1"
757-
x="0"
758-
y="0"
759-
width="60.002"
760-
height="59.997"
761-
style={{ fill: 'none' }}
762-
/>
763-
<clipPath id="_clip1">
764-
<rect x="0" y="0" width="60.002" height="59.997" />
765-
</clipPath>
766-
<g clip-path="url(#_clip1)">
767-
<g id="Artboard">
768-
<path
769-
id="Shape"
770-
d="M24.1,38.914l6.8,-0c0.3,-0 0.6,0.3 0.6,0.6l-0,4.3c-0,8.1 -5.9,15.2 -13.9,16.1c-9.5,1.1 -17.6,-6.4 -17.6,-15.7c0,-6.7 4.2,-12.4 10.1,-14.7c0.4,-0.1 0.8,0.2 0.8,0.6l0,7.8c0,0.2 -0.1,0.3 -0.2,0.4c-2,1.8 -3.2,4.5 -2.5,7.5c0.6,3 3,5.4 6,6c5,1 9.3,-2.8 9.3,-7.6l0,-4.7c0,-0.4 0.2,-0.6 0.6,-0.6Z"
771-
style={{ fill: '#9ca3ae', fillRule: 'nonzero' }}
772-
/>
773-
<path
774-
id="Shape1"
775-
d="M15.7,36.414l4.7,-0c0.3,-0 0.6,-0.3 0.6,-0.6l-0,-2.1c-0,-2.9 -2.4,-5.3 -5.3,-5.3c-0.7,-0 -1.4,0.1 -2.1,0.2c-0.3,-0 -0.5,0.3 -0.5,0.6l-0,6.9c-0,0.4 0.4,0.7 0.7,0.6c0.6,-0.2 1.3,-0.3 1.9,-0.3Z"
776-
style={{ fill: '#9ca3ae', fillRule: 'nonzero' }}
777-
/>
778-
<path
779-
id="Shape2"
780-
d="M33.9,29.014c0,4.1 3.3,7.4 7.3,7.4l0.1,-0c0.3,-0 0.6,-0.3 0.6,-0.6l0,-6.8c0,-0.3 -0.3,-0.6 -0.6,-0.6l-6.8,-0c-0.4,-0 -0.6,0.3 -0.6,0.6Z"
781-
style={{ fill: '#9ca3ae', fillRule: 'nonzero' }}
782-
/>
783-
<path
784-
id="Shape3"
785-
d="M44.1,35.514l0,-7c0,-0.3 0.2,-0.5 0.4,-0.6c4.8,-1.4 8.1,-6.2 7.2,-11.6c-0.7,-4.1 -4,-7.5 -8.1,-8.2c-6.5,-1.2 -12.2,3.8 -12.2,10.1l0,7.4c0,0.3 -0.3,0.6 -0.6,0.6l-6.8,-0c-0.3,-0 -0.6,-0.3 -0.6,-0.6l0,-6.9c0,-9.9 7.7,-18.3 17.5,-18.7c10.4,-0.4 18.9,7.9 18.9,18.2c0,9 -6.5,16.5 -15.1,17.9c-0.2,0.1 -0.6,-0.2 -0.6,-0.6Z"
786-
style={{ fill: '#9ca3ae', fillRule: 'nonzero' }}
787-
/>
788-
<path
789-
id="Shape4"
790-
d="M30.8,28.414l-6.8,-0c-0.3,-0 -0.6,0.3 -0.6,0.6l0,6.8c0,0.3 0.3,0.6 0.6,0.6l6.8,-0c0.3,-0 0.6,-0.3 0.6,-0.6l0,-6.8c0,-0.3 -0.2,-0.6 -0.6,-0.6Z"
791-
style={{ fill: '#9ca3ae', fillRule: 'nonzero' }}
792-
/>
793-
</g>
794-
</g>
795-
</svg>
796-
);
797-
}
798-
799731
function TiDBCloudIcon() {
800732
return (
801733
<svg

0 commit comments

Comments
 (0)