Skip to content

Commit 4ca3eaf

Browse files
committed
chore: fix conflicts
2 parents 528001c + 28fb6de commit 4ca3eaf

File tree

30 files changed

+4541
-3359
lines changed

30 files changed

+4541
-3359
lines changed

accelerate/remix-starter/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,12 @@
7070
"eslint-plugin-import": "2.32.0",
7171
"eslint-plugin-jsx-a11y": "6.10.2",
7272
"eslint-plugin-lodash": "8.0.0",
73-
"eslint-plugin-prettier": "5.5.1",
73+
"eslint-plugin-prettier": "5.5.3",
7474
"eslint-plugin-react": "7.37.5",
7575
"eslint-plugin-react-hooks": "5.2.0",
7676
"eslint-plugin-testing-library": "7.6.0",
7777
"jsdom": "26.1.0",
78-
"lint-staged": "16.1.2",
78+
"lint-staged": "16.1.4",
7979
"prettier": "3.6.2",
8080
"prisma": "6.9.0",
8181
"tailwindcss": "3.4.17",

accelerate/svelte-starter/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
},
1212
"devDependencies": {
1313
"@sveltejs/adapter-auto": "6.0.1",
14-
"@sveltejs/kit": "2.22.2",
14+
"@sveltejs/kit": "2.27.1",
1515
"@sveltejs/vite-plugin-svelte": "5.1.0",
1616
"@tailwindcss/typography": "0.5.16",
1717
"autoprefixer": "10.4.21",

deployment-platforms/edge/cloudflare-workers/with-d1/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"prisma": "6.9.0",
1515
"typescript": "5.8.2",
1616
"vitest": "3.2.4",
17-
"wrangler": "4.22.0"
17+
"wrangler": "4.28.0"
1818
},
1919
"dependencies": {
2020
"@prisma/adapter-d1": "6.9.0",
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
src/generated/
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# TypedSQL Example
2+
3+
This example shows how to use the TypedSQL feature of [Prisma ORM](https://www.prisma.io/docs/orm/overview/introduction/what-is-prisma) in a TypeScript project along with the [`prisma-client`](https://www.prisma.io/docs/orm/prisma-schema/overview/generators#prisma-client-preview) generator. TypedSQL allows you to write fully type-safe SQL queries and then run them via Prisma Client.
4+
5+
## Getting started
6+
7+
### 1. Download example and navigate into the project directory
8+
9+
Download this example:
10+
11+
```
12+
npx try-prisma@latest --template generator-prisma-client/basic-typedsql --install npm --name basic-typedsql
13+
```
14+
15+
Then, navigate into the project directory:
16+
17+
```
18+
cd basic-typedsql
19+
```
20+
21+
<details><summary><strong>Alternative:</strong> Clone the entire repo</summary>
22+
23+
Clone this repository:
24+
25+
```
26+
git clone [email protected]:prisma/prisma-examples.git --depth=1
27+
```
28+
29+
Install npm dependencies:
30+
31+
```
32+
cd prisma-examples/generator-prisma-client/basic-typedsql
33+
pnpm install
34+
```
35+
36+
</details>
37+
38+
### 2. Create and seed the database
39+
40+
Run the following command to create your SQLite database file. This also creates the `User` and `Post` tables that are defined in [`prisma/schema.prisma`](./prisma/schema.prisma):
41+
42+
```
43+
pnpm prisma migrate dev --name init
44+
```
45+
46+
When `pnpm prisma migrate dev` is executed against a newly created database, seeding is also triggered. The seed file in [`prisma/seed.ts`](./prisma/seed.ts) will be executed and your database will be populated with the sample data.
47+
48+
### 3. Generate Prisma Client with SQL
49+
50+
```
51+
pnpm prisma generate --sql
52+
```
53+
54+
This command runs `prisma generate --sql`, which will generate the Prisma Client and also check any SQL files in the `prisma/sql` directory. After type-checking the SQL files, they are compiled into JavaScript and added to the Prisma Client.
55+
56+
> [!TIP]
57+
> This also works with the `--watch` flag! If you want to automatically generate and watch for changes, you can use `pnpm prisma generate --sql --watch`.
58+
59+
### 4. Run the example
60+
61+
```
62+
npm run dev
63+
```
64+
65+
This command will run [`index.ts`](./index.ts), which will execute the SQL query defined in [`prisma/sql/conversionByVariant.sql`](./prisma/sql/conversionByVariant.sql) and print the results to the console.
66+
67+
## Project Structure
68+
69+
This example project is structured similarly to the [starter example](https://github.com/prisma/prisma-examples/tree/latest/orm/starter) with a key difference:
70+
71+
- [`prisma/sql/`](./prisma/sql/): Contains SQL query files that are type-checked by Prisma and then included in the generated Prisma Client.
72+
- [`prisma/sql/conversionByVariant.sql`](./prisma/sql/conversionByVariant.sql): Example SQL query used in the project.
73+
74+
Key areas to look at:
75+
1. Database schema: [`prisma/schema.prisma`](./prisma/schema.prisma)
76+
2. Example SQL query: [`prisma/sql/conversionByVariant.sql`](./prisma/sql/conversionByVariant.sql)
77+
3. Query execution: [`src/index.ts`](./src/index.ts)
78+
4. Data seeding: [`prisma/seed.ts`](./prisma/seed.ts)
79+
5. Build and run scripts: [`package.json`](./package.json)
80+
6. Configure the Prisma CLI: [`prisma.config.ts`](./prisma.config.ts)
81+
82+
## Next steps
83+
84+
- Check out the [Prisma docs](https://www.prisma.io/docs)
85+
- [Join our community on Discord](https://pris.ly/discord?utm_source=github&utm_medium=prisma_examples&utm_content=next_steps_section) to share feedback and interact with other users.
86+
- [Subscribe to our YouTube channel](https://pris.ly/youtube?utm_source=github&utm_medium=prisma_examples&utm_content=next_steps_section) for live demos and video tutorials.
87+
- [Follow us on X](https://pris.ly/x?utm_source=github&utm_medium=prisma_examples&utm_content=next_steps_section) for the latest updates.
88+
- Report issues or ask [questions on GitHub](https://pris.ly/github?utm_source=github&utm_medium=prisma_examples&utm_content=next_steps_section).
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{
2+
"private": true,
3+
"name": "basic-typedsql",
4+
"description": "A simple TypedSQL example using `prisma-client`.",
5+
"main": "src/index.ts",
6+
"scripts": {
7+
"start": "tsx src/index.ts",
8+
"dev": "tsx src/index.ts --watch",
9+
"test": "tsx src/index.ts",
10+
"debug": "tsx src/index.ts"
11+
},
12+
"keywords": [],
13+
"author": "",
14+
"license": "ISC",
15+
"dependencies": {
16+
"@prisma/client": "6.13.0"
17+
},
18+
"devDependencies": {
19+
"@types/node": "22.15.32",
20+
"prisma": "6.13.0",
21+
"tsx": "4.20.3"
22+
},
23+
"packageManager": "[email protected]+sha512.499434c9d8fdd1a2794ebf4552b3b25c0a633abcee5bb15e7b5de90f32f47b513aca98cd5cfd001c31f0db454bc3804edccd578501e4ca293a6816166bbd9f81"
24+
}

0 commit comments

Comments
 (0)