Skip to content

Commit 920131d

Browse files
committed
update koa project
1 parent 03c6844 commit 920131d

File tree

14 files changed

+4541
-11
lines changed

14 files changed

+4541
-11
lines changed

orm/koa/package.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,25 @@
33
"version": "1.0.0",
44
"license": "MIT",
55
"scripts": {
6-
"dev": "ts-node src/index.ts"
6+
"dev": "tsx src/index.ts"
77
},
88
"dependencies": {
99
"@koa/router": "13.1.1",
10-
"@prisma/client": "6.9.0",
10+
"@prisma/client": "6.17.1",
11+
"@prisma/extension-accelerate": "2.0.2",
12+
"dotenv": "^17.2.3",
1113
"koa": "3.0.0",
12-
"koa-body": "6.0.1",
13-
"@prisma/extension-accelerate": "2.0.2"
14+
"koa-body": "6.0.1"
1415
},
1516
"devDependencies": {
1617
"@types/koa": "2.15.0",
1718
"@types/koa__router": "12.0.4",
1819
"@types/node": "22.15.32",
19-
"prisma": "6.9.0",
20-
"ts-node": "10.9.2",
20+
"prisma": "6.17.1",
21+
"tsx": "^4.20.6",
2122
"typescript": "5.8.2"
2223
},
2324
"prisma": {
24-
"seed": "ts-node prisma/seed.ts"
25+
"seed": "tsx prisma/seed.ts"
2526
}
2627
}

orm/koa/prisma/schema.prisma

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
generator client {
2-
provider = "prisma-client-js"
2+
provider = "prisma-client"
3+
engineType = "client"
4+
output = "../src/generated/prisma"
35
}
4-
56
datasource db {
67
provider = "postgresql"
78
url = env("DATABASE_URL")

orm/koa/prisma/seed.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { PrismaClient, Prisma } from '@prisma/client'
1+
import { PrismaClient, Prisma } from '../src/generated/prisma/client'
22
import { withAccelerate } from '@prisma/extension-accelerate'
33

44
const prisma = new PrismaClient().$extends(withAccelerate())
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
/* !!! This is code generated by Prisma. Do not edit directly. !!! */
3+
/* eslint-disable */
4+
// @ts-nocheck
5+
/*
6+
* This file should be your main import to use Prisma-related types and utilities in a browser.
7+
* Use it to get access to models, enums, and input types.
8+
*
9+
* This file does not contain a `PrismaClient` class, nor several other helpers that are intended as server-side only.
10+
* See `client.ts` for the standard, server-side entry point.
11+
*
12+
* 🟢 You can import this file directly.
13+
*/
14+
15+
import * as Prisma from './internal/prismaNamespaceBrowser.js'
16+
export { Prisma }
17+
export * as $Enums from './enums.js'
18+
export * from './enums.js';
19+
/**
20+
* Model User
21+
*
22+
*/
23+
export type User = Prisma.UserModel
24+
/**
25+
* Model Post
26+
*
27+
*/
28+
export type Post = Prisma.PostModel
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
2+
/* !!! This is code generated by Prisma. Do not edit directly. !!! */
3+
/* eslint-disable */
4+
// @ts-nocheck
5+
/*
6+
* This file should be your main import to use Prisma. Through it you get access to all the models, enums, and input types.
7+
* If you're looking for something you can import in the client-side of your application, please refer to the `browser.ts` file instead.
8+
*
9+
* 🟢 You can import this file directly.
10+
*/
11+
12+
import * as process from 'node:process'
13+
import * as path from 'node:path'
14+
import { fileURLToPath } from 'node:url'
15+
globalThis['__dirname'] = path.dirname(fileURLToPath(import.meta.url))
16+
17+
import * as runtime from "@prisma/client/runtime/client"
18+
import * as $Enums from "./enums.js"
19+
import * as $Class from "./internal/class.js"
20+
import * as Prisma from "./internal/prismaNamespace.js"
21+
22+
export * as $Enums from './enums.js'
23+
export * from "./enums.js"
24+
/**
25+
* ## Prisma Client
26+
*
27+
* Type-safe database client for TypeScript
28+
* @example
29+
* ```
30+
* const prisma = new PrismaClient()
31+
* // Fetch zero or more Users
32+
* const users = await prisma.user.findMany()
33+
* ```
34+
*
35+
* Read more in our [docs](https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-client).
36+
*/
37+
export const PrismaClient = $Class.getPrismaClientClass(__dirname)
38+
export type PrismaClient<LogOpts extends Prisma.LogLevel = never, OmitOpts extends Prisma.PrismaClientOptions["omit"] = Prisma.PrismaClientOptions["omit"], ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = $Class.PrismaClient<LogOpts, OmitOpts, ExtArgs>
39+
export { Prisma }
40+
41+
42+
43+
/**
44+
* Model User
45+
*
46+
*/
47+
export type User = Prisma.UserModel
48+
/**
49+
* Model Post
50+
*
51+
*/
52+
export type Post = Prisma.PostModel

0 commit comments

Comments
 (0)