Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
754 changes: 754 additions & 0 deletions databases/cockroachdb/bun.lock

Large diffs are not rendered by default.

13 changes: 7 additions & 6 deletions databases/cockroachdb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,24 @@
"author": "",
"main": "index.js",
"scripts": {
"start": "ts-node ./src/script.ts",
"start": "tsx ./src/script.ts",
"test": "jest",
"test:watch": "jest --watch"
},
"dependencies": {
"@prisma/client": "6.9.0",
"@prisma/adapter-pg": "6.20.0-integration-next.3",
"@prisma/client": "6.20.0-integration-next.3",
"dotenv": "16.6.1",
"jest": "29.7.0"
},
"devDependencies": {
"@types/jest": "29.5.14",
"@types/node": "22.19.0",
"@types/prettyjson": "0.0.33",
"prettyjson": "1.2.5",
"prisma": "6.9.0",
"prisma": "6.20.0-integration-next.3",
"ts-jest": "29.4.5",
"ts-node": "10.9.2",
"ts-node-dev": "2.0.0",
"tsx": "^4.20.6",
"typescript": "5.8.2"
}
}
}
6 changes: 4 additions & 2 deletions databases/cockroachdb/prisma/schema.prisma
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
generator client {
provider = "prisma-client-js"
provider = "prisma-client"
output = "./generated"
engineType = "client"
}

datasource db {
Expand All @@ -25,7 +27,7 @@ model Post {
authorId String
author User @relation(fields: [authorId], references: [id])
comments Comment[]
tags Tag[]
tags Tag[]
}

model Comment {
Expand Down
11 changes: 9 additions & 2 deletions databases/cockroachdb/src/script.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
import { PrismaClient } from '@prisma/client'
import { PrismaClient } from '../prisma/generated/client'
import prettyjson from 'prettyjson'
import { PrismaPg } from '@prisma/adapter-pg'
import 'dotenv/config'

const prisma = new PrismaClient()
const adapter = new PrismaPg({
connectionString: process.env.DATABASE_URL,
})
const prisma = new PrismaClient({
adapter,
})

// A `main` function so that we can use async/await
async function main() {
Expand Down
11 changes: 9 additions & 2 deletions databases/cockroachdb/tests/prisma.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import { PrismaClient } from '@prisma/client'
import { PrismaClient } from '../prisma/generated/client'
import { PrismaPg } from '@prisma/adapter-pg'
import 'dotenv/config'

export const prisma = new PrismaClient()
const adapter = new PrismaPg({
connectionString: process.env.DATABASE_URL,
})
export const prisma = new PrismaClient({
adapter,
})

describe('example test with Prisma Client', () => {
beforeAll(async () => {
Expand Down
245 changes: 245 additions & 0 deletions databases/postgresql-supabase/bun.lock

Large diffs are not rendered by default.

18 changes: 8 additions & 10 deletions databases/postgresql-supabase/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,19 @@
"version": "1.0.0",
"license": "MIT",
"scripts": {
"dev": "ts-node script.ts",
"dev": "tsx script.ts",
"test": "jest",
"test:watch": "jest --watch"
},
"devDependencies": {
"@types/node": "22.19.0",
"prisma": "6.9.0",
"@types/node": "22.18.12",
"prisma": "6.20.0-integration-next.3",
"supabase": "2.30.4",
"ts-node": "10.9.2",
"typescript": "5.8.2"
"typescript": "5.8.2",
"tsx": "^4.20.6"
},
"dependencies": {
"@prisma/client": "6.9.0"
},
"prisma": {
"seed": "ts-node prisma/seed.ts"
"@prisma/adapter-pg": "6.20.0-integration-next.3",
"@prisma/client": "6.20.0-integration-next.3"
}
}
}
12 changes: 12 additions & 0 deletions databases/postgresql-supabase/prisma.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import "dotenv/config";
import { defineConfig, env } from "prisma/config";

export default defineConfig({
schema: "prisma/schema.prisma",
migrations: {
path: "prisma/migrations",
},
datasource: {
url: env("DATABASE_URL"),
},
});
8 changes: 5 additions & 3 deletions databases/postgresql-supabase/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
// learn more about it in the docs: https://pris.ly/d/prisma-schema

generator client {
provider = "prisma-client-js"
provider = "prisma-client"
output = "./generated"
engineType = "client"
}

datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
provider = "postgresql"
url = env("DATABASE_URL")
}

model User {
Expand Down
10 changes: 8 additions & 2 deletions databases/postgresql-supabase/prisma/seed.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import { PrismaClient, Prisma } from '@prisma/client'
import { PrismaClient, Prisma } from './generated/client'
import {PrismaPg} from "@prisma/adapter-pg"

const prisma = new PrismaClient();
const adapter = new PrismaPg({
connectionString: process.env.DATABASE_URL,
})
const prisma = new PrismaClient({
adapter,
});

const userData = [
{
Expand Down
10 changes: 8 additions & 2 deletions databases/postgresql-supabase/script.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
import { PrismaClient } from '@prisma/client'
import { PrismaClient } from './prisma/generated/client'
import {PrismaPg} from "@prisma/adapter-pg"

const prisma = new PrismaClient();
const adapter = new PrismaPg({
connectionString: process.env.DATABASE_URL,
})
const prisma = new PrismaClient({
adapter,
});

async function main() {

Expand Down
158 changes: 158 additions & 0 deletions databases/prisma-postgres/bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading