Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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
8 changes: 3 additions & 5 deletions .github/get-ppg-dev/index.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
import { context, trace } from "@opentelemetry/api";
import { AsyncLocalStorageContextManager } from "@opentelemetry/context-async-hooks";
import { BasicTracerProvider } from "@opentelemetry/sdk-trace-base";
import { unstable_startServer } from '@prisma/dev'
import { startPrismaDevServer } from '@prisma/dev'

context.setGlobalContextManager(new AsyncLocalStorageContextManager());
trace.setGlobalTracerProvider(new BasicTracerProvider());

async function main() {
const server = await unstable_startServer({
persistenceMode: 'stateless',
})
const server = await startPrismaDevServer({ databaseIdleTimeoutMillis: 300 })

// Emit only the Prisma-compatible URL for CI shell script to capture
console.log(server.ppg.url)
console.log(server.database.connectionString)

// Wait for shutdown signal
process.once('SIGTERM', async () => {
Expand Down
1 change: 1 addition & 0 deletions .github/tests/data-modeling/delegated-types/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
set -eu

npm install
npx prisma generate
npx prisma migrate dev --name init
npm run test
7 changes: 4 additions & 3 deletions .github/tests/databases/prisma-postgres/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ NODE_PID=$!
echo "🔎 Waiting for Prisma Dev to emit DATABASE_URL..."
MAX_WAIT=60
WAITED=0
until grep -q '^prisma+postgres://' "$LOG_FILE"; do
until grep -q '^postgres://' "$LOG_FILE"; do
sleep 1
WAITED=$((WAITED + 1))
if [[ "$WAITED" -ge "$MAX_WAIT" ]]; then
Expand All @@ -37,15 +37,16 @@ until grep -q '^prisma+postgres://' "$LOG_FILE"; do
fi
done

DB_URL=$(grep '^prisma+postgres://' "$LOG_FILE" | tail -1)
DB_URL=$(grep '^postgres://' "$LOG_FILE" | tail -1)
export DATABASE_URL="$DB_URL"
echo "✅ DATABASE_URL: $DATABASE_URL"

popd > /dev/null # Go back to databases/prisma-postgres

# Run migration
echo "📐 Running prisma migrate dev..."
npx prisma migrate dev --name init --skip-seed
npx prisma generate
npx prisma migrate dev --name init

# Run queries (if any)
echo "🧪 Running queries..."
Expand Down
5 changes: 3 additions & 2 deletions .github/tests/orm/ai-sdk-nextjs/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ NODE_PID=$!
echo "🔎 Waiting for Prisma Dev to emit DATABASE_URL..."
MAX_WAIT=60
WAITED=0
until grep -q '^prisma+postgres://' "$LOG_FILE"; do
until grep -q '^postgres://' "$LOG_FILE"; do
sleep 1
WAITED=$((WAITED + 1))
if [ "$WAITED" -ge "$MAX_WAIT" ]; then
Expand All @@ -46,13 +46,14 @@ until grep -q '^prisma+postgres://' "$LOG_FILE"; do
fi
done

DB_URL=$(grep '^prisma+postgres://' "$LOG_FILE" | tail -1)
DB_URL=$(grep '^postgres://' "$LOG_FILE" | tail -1)
export DATABASE_URL="$DB_URL"
echo "✅ DATABASE_URL: $DATABASE_URL"

popd > /dev/null

npm install
npx prisma generate
npx prisma migrate dev --name init --schema prisma/schema.prisma
npx prisma db seed
npm run dev &
Expand Down
5 changes: 3 additions & 2 deletions .github/tests/orm/astro/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ NODE_PID=$!
echo "🔎 Waiting for Prisma Dev to emit DATABASE_URL..."
MAX_WAIT=60
WAITED=0
until grep -q '^prisma+postgres://' "$LOG_FILE"; do
until grep -q '^postgres://' "$LOG_FILE"; do
sleep 1
WAITED=$((WAITED + 1))
if [ "$WAITED" -ge "$MAX_WAIT" ]; then
Expand All @@ -46,13 +46,14 @@ until grep -q '^prisma+postgres://' "$LOG_FILE"; do
fi
done

DB_URL=$(grep '^prisma+postgres://' "$LOG_FILE" | tail -1)
DB_URL=$(grep '^postgres://' "$LOG_FILE" | tail -1)
export DATABASE_URL="$DB_URL"
echo "✅ DATABASE_URL: $DATABASE_URL"

popd > /dev/null

npm install
npx prisma generate
npx prisma migrate dev --name init --schema prisma/schema.prisma
npm run dev &
pid=$!
Expand Down
5 changes: 3 additions & 2 deletions .github/tests/orm/authjs-nextjs/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ NODE_PID=$!
echo "🔎 Waiting for Prisma Dev to emit DATABASE_URL..."
MAX_WAIT=60
WAITED=0
until grep -q '^prisma+postgres://' "$LOG_FILE"; do
until grep -q '^postgres://' "$LOG_FILE"; do
sleep 1
WAITED=$((WAITED + 1))
if [ "$WAITED" -ge "$MAX_WAIT" ]; then
Expand All @@ -46,13 +46,14 @@ until grep -q '^prisma+postgres://' "$LOG_FILE"; do
fi
done

DB_URL=$(grep '^prisma+postgres://' "$LOG_FILE" | tail -1)
DB_URL=$(grep '^postgres://' "$LOG_FILE" | tail -1)
export DATABASE_URL="$DB_URL"
echo "✅ DATABASE_URL: $DATABASE_URL"

popd > /dev/null

npm install
npx prisma generate
npx prisma migrate dev --name init --schema prisma/schema.prisma
npx prisma db seed
npm run dev &
Expand Down
5 changes: 3 additions & 2 deletions .github/tests/orm/betterauth-astro/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ NODE_PID=$!
echo "🔎 Waiting for Prisma Dev to emit DATABASE_URL..."
MAX_WAIT=60
WAITED=0
until grep -q '^prisma+postgres://' "$LOG_FILE"; do
until grep -q '^postgres://' "$LOG_FILE"; do
sleep 1
WAITED=$((WAITED + 1))
if [ "$WAITED" -ge "$MAX_WAIT" ]; then
Expand All @@ -46,13 +46,14 @@ until grep -q '^prisma+postgres://' "$LOG_FILE"; do
fi
done

DB_URL=$(grep '^prisma+postgres://' "$LOG_FILE" | tail -1)
DB_URL=$(grep '^postgres://' "$LOG_FILE" | tail -1)
export DATABASE_URL="$DB_URL"
echo "✅ DATABASE_URL: $DATABASE_URL"

popd > /dev/null

npm install
npx prisma generate
npx prisma migrate dev --name init --schema prisma/schema.prisma
npm run dev &
pid=$!
Expand Down
5 changes: 3 additions & 2 deletions .github/tests/orm/betterauth-nextjs/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ NODE_PID=$!
echo "🔎 Waiting for Prisma Dev to emit DATABASE_URL..."
MAX_WAIT=60
WAITED=0
until grep -q '^prisma+postgres://' "$LOG_FILE"; do
until grep -q '^postgres://' "$LOG_FILE"; do
sleep 1
WAITED=$((WAITED + 1))
if [ "$WAITED" -ge "$MAX_WAIT" ]; then
Expand All @@ -46,13 +46,14 @@ until grep -q '^prisma+postgres://' "$LOG_FILE"; do
fi
done

DB_URL=$(grep '^prisma+postgres://' "$LOG_FILE" | tail -1)
DB_URL=$(grep '^postgres://' "$LOG_FILE" | tail -1)
export DATABASE_URL="$DB_URL"
echo "✅ DATABASE_URL: $DATABASE_URL"

popd > /dev/null

npm install
npx prisma generate
npx prisma migrate dev --name init --schema prisma/schema.prisma
npx prisma db seed
npm run dev &
Expand Down
5 changes: 3 additions & 2 deletions .github/tests/orm/clerk-astro/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ NODE_PID=$!
echo "🔎 Waiting for Prisma Dev to emit DATABASE_URL..."
MAX_WAIT=60
WAITED=0
until grep -q '^prisma+postgres://' "$LOG_FILE"; do
until grep -q '^postgres://' "$LOG_FILE"; do
sleep 1
WAITED=$((WAITED + 1))
if [ "$WAITED" -ge "$MAX_WAIT" ]; then
Expand All @@ -46,13 +46,14 @@ until grep -q '^prisma+postgres://' "$LOG_FILE"; do
fi
done

DB_URL=$(grep '^prisma+postgres://' "$LOG_FILE" | tail -1)
DB_URL=$(grep '^postgres://' "$LOG_FILE" | tail -1)
export DATABASE_URL="$DB_URL"
echo "✅ DATABASE_URL: $DATABASE_URL"

popd > /dev/null

npm install
npx prisma generate
npx prisma migrate dev --name init
npm run dev &
pid=$!
Expand Down
5 changes: 3 additions & 2 deletions .github/tests/orm/clerk-nextjs/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ NODE_PID=$!
echo "🔎 Waiting for Prisma Dev to emit DATABASE_URL..."
MAX_WAIT=60
WAITED=0
until grep -q '^prisma+postgres://' "$LOG_FILE"; do
until grep -q '^postgres://' "$LOG_FILE"; do
sleep 1
WAITED=$((WAITED + 1))
if [ "$WAITED" -ge "$MAX_WAIT" ]; then
Expand All @@ -46,13 +46,14 @@ until grep -q '^prisma+postgres://' "$LOG_FILE"; do
fi
done

DB_URL=$(grep '^prisma+postgres://' "$LOG_FILE" | tail -1)
DB_URL=$(grep '^postgres://' "$LOG_FILE" | tail -1)
export DATABASE_URL="$DB_URL"
echo "✅ DATABASE_URL: $DATABASE_URL"

popd > /dev/null

npm install
npx prisma generate
npx prisma migrate dev --name init
npm run dev &
pid=$!
Expand Down
5 changes: 3 additions & 2 deletions .github/tests/orm/cloudflare-workers/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ NODE_PID=$!
echo "🔎 Waiting for Prisma Dev to emit DATABASE_URL..."
MAX_WAIT=60
WAITED=0
until grep -q '^prisma+postgres://' "$LOG_FILE"; do
until grep -q '^postgres://' "$LOG_FILE"; do
sleep 1
WAITED=$((WAITED + 1))
if [ "$WAITED" -ge "$MAX_WAIT" ]; then
Expand All @@ -46,13 +46,14 @@ until grep -q '^prisma+postgres://' "$LOG_FILE"; do
fi
done

DB_URL=$(grep '^prisma+postgres://' "$LOG_FILE" | tail -1)
DB_URL=$(grep '^postgres://' "$LOG_FILE" | tail -1)
export DATABASE_URL="$DB_URL"
echo "✅ DATABASE_URL: $DATABASE_URL"

popd > /dev/null

npm install
npx prisma generate
npx prisma migrate dev --name init --schema prisma/schema.prisma
npx prisma db seed
npm run dev &
Expand Down
7 changes: 4 additions & 3 deletions .github/tests/orm/express/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ NODE_PID=$!
echo "🔎 Waiting for Prisma Dev to emit DATABASE_URL..."
MAX_WAIT=60
WAITED=0
until grep -q '^prisma+postgres://' "$LOG_FILE"; do
until grep -q '^postgres://' "$LOG_FILE"; do
sleep 1
WAITED=$((WAITED + 1))
if [ "$WAITED" -ge "$MAX_WAIT" ]; then
Expand All @@ -46,13 +46,14 @@ until grep -q '^prisma+postgres://' "$LOG_FILE"; do
fi
done

DB_URL=$(grep '^prisma+postgres://' "$LOG_FILE" | tail -1)
DB_URL=$(grep '^postgres://' "$LOG_FILE" | tail -1)
export DATABASE_URL="$DB_URL"
echo "✅ DATABASE_URL: $DATABASE_URL"

popd > /dev/null # Back to databases/prisma-postgres

# Run migrations + seed
# Generate client + run migrations + seed
npx prisma generate
npx prisma migrate dev --name init
npx prisma db seed

Expand Down
5 changes: 3 additions & 2 deletions .github/tests/orm/fastify-graphql-sdl-first/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ NODE_PID=$!
echo "🔎 Waiting for Prisma Dev to emit DATABASE_URL..."
MAX_WAIT=60
WAITED=0
until grep -q '^prisma+postgres://' "$LOG_FILE"; do
until grep -q '^postgres://' "$LOG_FILE"; do
sleep 1
WAITED=$((WAITED + 1))
if [ "$WAITED" -ge "$MAX_WAIT" ]; then
Expand All @@ -46,13 +46,14 @@ until grep -q '^prisma+postgres://' "$LOG_FILE"; do
fi
done

DB_URL=$(grep '^prisma+postgres://' "$LOG_FILE" | tail -1)
DB_URL=$(grep '^postgres://' "$LOG_FILE" | tail -1)
export DATABASE_URL="$DB_URL"
echo "✅ DATABASE_URL: $DATABASE_URL"

popd > /dev/null # Back to orm/fastify-graphql-sdl-first

# Run migrations and seed
npx prisma generate
npx prisma migrate dev --name init
npx prisma db seed

Expand Down
7 changes: 4 additions & 3 deletions .github/tests/orm/fastify-graphql/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ NODE_PID=$!
echo "🔎 Waiting for Prisma Dev to emit DATABASE_URL..."
MAX_WAIT=60
WAITED=0
until grep -q '^prisma+postgres://' "$LOG_FILE"; do
until grep -q '^postgres://' "$LOG_FILE"; do
sleep 1
WAITED=$((WAITED + 1))
if [ "$WAITED" -ge "$MAX_WAIT" ]; then
Expand All @@ -46,14 +46,15 @@ until grep -q '^prisma+postgres://' "$LOG_FILE"; do
fi
done

DB_URL=$(grep '^prisma+postgres://' "$LOG_FILE" | tail -1)
DB_URL=$(grep '^postgres://' "$LOG_FILE" | tail -1)
export DATABASE_URL="$DB_URL"
echo "✅ DATABASE_URL: $DATABASE_URL"

popd > /dev/null # Back to orm/fastify-graphql

# Run migrations and seed
npx prisma migrate reset --force --skip-seed
npx prisma migrate reset --force
npx prisma generate
npx prisma migrate dev --name init
npx prisma db seed

Expand Down
5 changes: 3 additions & 2 deletions .github/tests/orm/fastify/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ NODE_PID=$!
echo "🔎 Waiting for Prisma Dev to emit DATABASE_URL..."
MAX_WAIT=60
WAITED=0
until grep -q '^prisma+postgres://' "$LOG_FILE"; do
until grep -q '^postgres://' "$LOG_FILE"; do
sleep 1
WAITED=$((WAITED + 1))
if [ "$WAITED" -ge "$MAX_WAIT" ]; then
Expand All @@ -46,13 +46,14 @@ until grep -q '^prisma+postgres://' "$LOG_FILE"; do
fi
done

DB_URL=$(grep '^prisma+postgres://' "$LOG_FILE" | tail -1)
DB_URL=$(grep '^postgres://' "$LOG_FILE" | tail -1)
export DATABASE_URL="$DB_URL"
echo "✅ DATABASE_URL: $DATABASE_URL"

popd > /dev/null # Back to orm/fastify

# Run migrations and seed
npx prisma generate
npx prisma migrate dev --name init
npx prisma db seed

Expand Down
5 changes: 3 additions & 2 deletions .github/tests/orm/graphql-auth/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ NODE_PID=$!
echo "🔎 Waiting for Prisma Dev to emit DATABASE_URL..."
MAX_WAIT=60
WAITED=0
until grep -q '^prisma+postgres://' "$LOG_FILE"; do
until grep -q '^postgres://' "$LOG_FILE"; do
sleep 1
WAITED=$((WAITED + 1))
if [ "$WAITED" -ge "$MAX_WAIT" ]; then
Expand All @@ -46,13 +46,14 @@ until grep -q '^prisma+postgres://' "$LOG_FILE"; do
fi
done

DB_URL=$(grep '^prisma+postgres://' "$LOG_FILE" | tail -1)
DB_URL=$(grep '^postgres://' "$LOG_FILE" | tail -1)
export DATABASE_URL="$DB_URL"
echo "✅ DATABASE_URL: $DATABASE_URL"

popd > /dev/null # Back to orm/graphql-auth

# Run migrations and seed
npx prisma generate
npx prisma migrate dev --name init
npx prisma db seed

Expand Down
Loading
Loading