Skip to content

Commit

Permalink
docs: update prisma seed (#1948)
Browse files Browse the repository at this point in the history
  • Loading branch information
keyding committed Jul 22, 2024
1 parent 46a4e2d commit 3a1b94d
Show file tree
Hide file tree
Showing 11 changed files with 45 additions and 40 deletions.
5 changes: 5 additions & 0 deletions .changeset/twenty-items-cry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-t3-app": patch
---

Update seed.ts in prisma in documentation
8 changes: 4 additions & 4 deletions www/src/pages/ar/usage/prisma.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ dir: rtl
```

```ts:prisma/seed.ts
import { prisma } from "../src/server/db/client";
import { db } from "../src/server/db/client";

async function main() {
const id = "cl9ebqhxk00003b600tymydho";
await prisma.example.upsert({
await db.example.upsert({
where: {
id,
},
Expand All @@ -59,11 +59,11 @@ async function main() {

main()
.then(async () => {
await prisma.$disconnect();
await db.$disconnect();
})
.catch(async (e) => {
console.error(e);
await prisma.$disconnect();
await db.$disconnect();
process.exit(1);
});
```
Expand Down
8 changes: 4 additions & 4 deletions www/src/pages/es/usage/prisma.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ La base de datos predeterminada es una base de datos SQLite, que es excelente pa
```

```ts:prisma/seed.ts
import { prisma } from "../src/server/db/client";
import { db } from "../src/server/db/client";

async function main() {
const id = "cl9ebqhxk00003b600tymydho";
await prisma.example.upsert({
await db.example.upsert({
where: {
id,
},
Expand All @@ -56,11 +56,11 @@ async function main() {

main()
.then(async () => {
await prisma.$disconnect();
await db.$disconnect();
})
.catch(async (e) => {
console.error(e);
await prisma.$disconnect();
await db.$disconnect();
process.exit(1);
});
```
Expand Down
8 changes: 4 additions & 4 deletions www/src/pages/fr/usage/prisma.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ La base de données par défaut est une base de données SQLite, idéale pour le
```

```ts:prisma/seed.ts
import { prisma } from "../src/server/db";
import { db } from "../src/server/db";

async function main() {
const id = "cl9ebqhxk00003b600tymydho";
await prisma.example.upsert({
await db.example.upsert({
where: {
id,
},
Expand All @@ -56,11 +56,11 @@ async function main() {

main()
.then(async () => {
await prisma.$disconnect();
await db.$disconnect();
})
.catch(async (e) => {
console.error(e);
await prisma.$disconnect();
await db.$disconnect();
process.exit(1);
});
```
Expand Down
8 changes: 4 additions & 4 deletions www/src/pages/ja/usage/prisma.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ NextAuth.js と Prisma を組み合わせて選択すると、`User`, `Session`,
```

```ts:prisma/seed.ts
import { prisma } from "../src/server/db";
import { db } from "../src/server/db";

async function main() {
const id = "cl9ebqhxk00003b600tymydho";
await prisma.example.upsert({
await db.example.upsert({
where: {
id,
},
Expand All @@ -56,11 +56,11 @@ async function main() {

main()
.then(async () => {
await prisma.$disconnect();
await db.$disconnect();
})
.catch(async (e) => {
console.error(e);
await prisma.$disconnect();
await db.$disconnect();
process.exit(1);
});
```
Expand Down
8 changes: 4 additions & 4 deletions www/src/pages/no/usage/prisma.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ Standarddatabasen er en SQLite-database, som er meget godt egnet for utvikling o
```

```ts:prisma/seed.ts
import { prisma } from "../src/server/db/client";
import { db } from "../src/server/db/client";

async function main() {
const id = "cl9ebqhxk00003b600tymydho";
await prisma.example.upsert({
await db.example.upsert({
where: {
id,
},
Expand All @@ -56,11 +56,11 @@ async function main() {

main()
.then(async () => {
await prisma.$disconnect();
await db.$disconnect();
})
.catch(async (e) => {
console.error(e);
await prisma.$disconnect();
await db.$disconnect();
process.exit(1);
});
```
Expand Down
8 changes: 4 additions & 4 deletions www/src/pages/pl/usage/prisma.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ Domyślna baza danych to baza SQLite, która jest znakomita do szybkiego pisania
```

```ts:prisma/seed.ts
import { prisma } from "../src/server/db/client";
import { db } from "../src/server/db/client";

async function main() {
const id = "cl9ebqhxk00003b600tymydho";
await prisma.example.upsert({
await db.example.upsert({
where: {
id,
},
Expand All @@ -56,11 +56,11 @@ async function main() {

main()
.then(async () => {
await prisma.$disconnect();
await db.$disconnect();
})
.catch(async (e) => {
console.error(e);
await prisma.$disconnect();
await db.$disconnect();
process.exit(1);
});
```
Expand Down
8 changes: 4 additions & 4 deletions www/src/pages/pt/usage/prisma.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ O banco de dados padrão é um banco de dados SQLite, que é ótimo para desenvo
```

```ts:prisma/seed.ts
import { prisma } from "../src/server/db/client";
import { db } from "../src/server/db/client";

async function main() {
const id = "cl9ebqhxk00003b600tymydho";
await prisma.example.upsert({
await db.example.upsert({
where: {
id,
},
Expand All @@ -56,11 +56,11 @@ async function main() {

main()
.then(async () => {
await prisma.$disconnect();
await db.$disconnect();
})
.catch(async (e) => {
console.error(e);
await prisma.$disconnect();
await db.$disconnect();
process.exit(1);
});
```
Expand Down
8 changes: 4 additions & 4 deletions www/src/pages/ru/usage/prisma.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ Prisma это ORM для TypeScript, который позволяет опре
```

```ts:prisma/seed.ts
import { prisma } from "../src/server/db";
import { db } from "../src/server/db";

async function main() {
const id = "cl9ebqhxk00003b600tymydho";
await prisma.example.upsert({
await db.example.upsert({
where: {
id,
},
Expand All @@ -56,11 +56,11 @@ async function main() {

main()
.then(async () => {
await prisma.$disconnect();
await db.$disconnect();
})
.catch(async (e) => {
console.error(e);
await prisma.$disconnect();
await db.$disconnect();
process.exit(1);
});
```
Expand Down
8 changes: 4 additions & 4 deletions www/src/pages/uk/usage/prisma.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ Prisma це ORM для TypeScript, який дозволяє визначати
```

```ts:prisma/seed.ts
import { prisma } from "../src/server/db";
import { db } from "../src/server/db";

async function main() {
const id = "cl9ebqhxk00003b600tymydho";
await prisma.example.upsert({
await db.example.upsert({
where: {
id,
},
Expand All @@ -56,11 +56,11 @@ async function main() {

main()
.then(async () => {
await prisma.$disconnect();
await db.$disconnect();
})
.catch(async (e) => {
console.error(e);
await prisma.$disconnect();
await db.$disconnect();
process.exit(1);
});
```
Expand Down
8 changes: 4 additions & 4 deletions www/src/pages/zh-hans/usage/prisma.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ Prisma 客户端位于文件 `/server/db.ts`, 以全局变量被初始化(
```

```ts:prisma/seed.ts
import { prisma } from "../src/server/db";
import { db } from "../src/server/db";

async function main() {
const id = "cl9ebqhxk00003b600tymydho";
await prisma.example.upsert({
await db.example.upsert({
where: {
id,
},
Expand All @@ -56,11 +56,11 @@ async function main() {

main()
.then(async () => {
await prisma.$disconnect();
await db.$disconnect();
})
.catch(async (e) => {
console.error(e);
await prisma.$disconnect();
await db.$disconnect();
process.exit(1);
});
```
Expand Down

0 comments on commit 3a1b94d

Please sign in to comment.