Skip to content
3 changes: 3 additions & 0 deletions .github/scripts/check-engines-client.sh
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,9 @@ elif [ $CLIENT_ENGINE_TYPE == "wasm" ]; then
os_name=notset
;;
esac
elif [ $CLIENT_ENGINE_TYPE == "client" ]; then
echo "Client engine detected, skipping QE check"
exit 0
elif [ $CLIENT_ENGINE_TYPE == "<accelerate>" ]; then
echo "Accelerate: Enabled"
else
Expand Down
40 changes: 36 additions & 4 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,34 @@ jobs:
- turso-web-node-basic-esm
- turso-web-vercel-nextjs
- tidb-node-basic
clientEngine: ['library']
clientEngine: [library, client]
os: [ubuntu-22.04]
exclude:
- combo: neon-http-lambda-basic
clientEngine: client
- combo: neon-lambda-basic
clientEngine: client
- combo: planetscale-lambda-basic
clientEngine: client
- combo: pg-lambda-basic
clientEngine: client
- combo: turso-web-lambda-basic
clientEngine: client
- combo: turso-web-lambda-basic
clientEngine: client
- combo: neon-http-vercel-nextjs
clientEngine: client
- combo: neon-vercel-nextjs
clientEngine: client
- combo: planetscale-vercel-nextjs
clientEngine: client
- combo: pg-vercel-nextjs
clientEngine: client
- combo: turso-vercel-nextjs
clientEngine: client
- combo: turso-web-vercel-nextjs
clientEngine: client

runs-on: ${{ matrix.os }}
# To avoid race conditions when running tests, we need to avoid concurrency
# The tests should not be run concurrently for a given "combo"
Expand All @@ -172,6 +198,8 @@ jobs:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
DEBUG: 'prisma:driver-adapter*'
PRISMA_DISABLE_QUAINT_EXECUTORS: true
PRISMA_CLIENT_ENGINE_TYPE: ${{ matrix.clientEngine }}

# neon http
DRIVER_ADAPTERS_NEON_HTTP_LAMBDA_BASIC_DATABASE_URL: ${{ secrets.DRIVER_ADAPTERS_NEON_HTTP_LAMBDA_BASIC_DATABASE_URL }}
DRIVER_ADAPTERS_NEON_HTTP_NODE_BASIC_DATABASE_URL: ${{ secrets.DRIVER_ADAPTERS_NEON_HTTP_NODE_BASIC_DATABASE_URL }}
Expand Down Expand Up @@ -203,15 +231,19 @@ jobs:

- uses: pnpm/[email protected]

- name: Add queryCompiler preview feature when using client engine
if: ${{ matrix.clientEngine == 'client' }}
run: |
find . -name schema.prisma -exec sed -i \
-e 's/previewFeatures = \["driverAdapters"\]/previewFeatures = ["driverAdapters", "queryCompiler"]/' \
{} +

- uses: actions/setup-node@v4
with:
node-version: 18
cache: 'pnpm'
cache-dependency-path: ${{ github.job }}/${{ matrix.combo }}/pnpm-lock.yaml

- name: Define Client Engine Type to test
run: echo "PRISMA_CLIENT_ENGINE_TYPE=${{ matrix.clientEngine }}" >> $GITHUB_ENV

- name: Install Dependencies
run: pnpm install

Expand Down
7 changes: 5 additions & 2 deletions driver-adapters/neon-http-lambda-basic/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@ GENERATED_CLIENT=$(node -e "
")

pnpm esbuild index.js --bundle --platform=node --target=node18 --outfile=dist/index.js --format=cjs
cp "$GENERATED_CLIENT"/libquery_engine-rhel-openssl-1.0.x.so.node dist
cp "$GENERATED_CLIENT"/schema.prisma dist
QUERY_ENGINE_LIB="$GENERATED_CLIENT/libquery_engine-rhel-openssl-1.0.x.so.node"
if [ -f "$QUERY_ENGINE_LIB" ]; then
cp "$QUERY_ENGINE_LIB" dist
fi
cp "$GENERATED_CLIENT/schema.prisma" dist
zip -rj lambda.zip dist

aws lambda update-function-configuration --function-name driver-adapters-neon-http-lambda-basic --runtime nodejs18.x --environment "Variables={DRIVER_ADAPTERS_NEON_HTTP_LAMBDA_BASIC_DATABASE_URL=$DRIVER_ADAPTERS_NEON_HTTP_LAMBDA_BASIC_DATABASE_URL}" --timeout 30
Expand Down
2 changes: 1 addition & 1 deletion driver-adapters/neon-http-node-basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"private": true,
"scripts": {
"test": "jest index.test.js"
"test": "NODE_OPTIONS=--experimental-vm-modules jest index.test.js"
},
"devDependencies": {
"@jest/globals": "29.7.0",
Expand Down
7 changes: 5 additions & 2 deletions driver-adapters/neon-lambda-basic/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@ GENERATED_CLIENT=$(node -e "
")

pnpm esbuild index.js --bundle --platform=node --target=node18 --outfile=dist/index.js --format=cjs
cp "$GENERATED_CLIENT"/libquery_engine-rhel-openssl-1.0.x.so.node dist
cp "$GENERATED_CLIENT"/schema.prisma dist
QUERY_ENGINE_LIB="$GENERATED_CLIENT/libquery_engine-rhel-openssl-1.0.x.so.node"
if [ -f "$QUERY_ENGINE_LIB" ]; then
cp "$QUERY_ENGINE_LIB" dist
fi
cp "$GENERATED_CLIENT/schema.prisma" dist
zip -rj lambda.zip dist

aws lambda update-function-configuration --function-name driver-adapters-neon-lambda-basic --runtime nodejs18.x --environment "Variables={DRIVER_ADAPTERS_NEON_LAMBDA_BASIC_DATABASE_URL=$DRIVER_ADAPTERS_NEON_LAMBDA_BASIC_DATABASE_URL}" --timeout 30
Expand Down
2 changes: 1 addition & 1 deletion driver-adapters/neon-node-basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"private": true,
"scripts": {
"test": "jest index.test.js"
"test": "NODE_OPTIONS=--experimental-vm-modules jest index.test.js"
},
"devDependencies": {
"@jest/globals": "29.7.0",
Expand Down
7 changes: 5 additions & 2 deletions driver-adapters/pg-lambda-basic/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@ GENERATED_CLIENT=$(node -e "
")

pnpm esbuild index.js --bundle --platform=node --target=node18 --outfile=dist/index.js --format=cjs
cp "$GENERATED_CLIENT"/libquery_engine-rhel-openssl-1.0.x.so.node dist
cp "$GENERATED_CLIENT"/schema.prisma dist
QUERY_ENGINE_LIB="$GENERATED_CLIENT/libquery_engine-rhel-openssl-1.0.x.so.node"
if [ -f "$QUERY_ENGINE_LIB" ]; then
cp "$QUERY_ENGINE_LIB" dist
fi
cp "$GENERATED_CLIENT/schema.prisma" dist
zip -rj lambda.zip dist

aws lambda update-function-configuration --function-name driver-adapters-pg-lambda-basic --runtime nodejs18.x --environment "Variables={DATABASE_URL=$DATABASE_URL}" --timeout 30
Expand Down
2 changes: 1 addition & 1 deletion driver-adapters/pg-node-basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"private": true,
"scripts": {
"test": "jest index.test.js"
"test": "NODE_OPTIONS=--experimental-vm-modules jest index.test.js"
},
"devDependencies": {
"@jest/globals": "29.7.0",
Expand Down
7 changes: 5 additions & 2 deletions driver-adapters/planetscale-lambda-basic/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@ GENERATED_CLIENT=$(node -e "
")

pnpm esbuild index.js --bundle --platform=node --target=node18 --outfile=dist/index.js --format=cjs
cp "$GENERATED_CLIENT"/libquery_engine-rhel-openssl-1.0.x.so.node dist
cp "$GENERATED_CLIENT"/schema.prisma dist
QUERY_ENGINE_LIB="$GENERATED_CLIENT/libquery_engine-rhel-openssl-1.0.x.so.node"
if [ -f "$QUERY_ENGINE_LIB" ]; then
cp "$QUERY_ENGINE_LIB" dist
fi
cp "$GENERATED_CLIENT/schema.prisma" dist
zip -rj lambda.zip dist

aws lambda update-function-configuration --function-name driver-adapters-planetscale-lambda-basic --runtime nodejs18.x --environment "Variables={DATABASE_URL_PLANETSCALE=$DATABASE_URL_PLANETSCALE}" --timeout 30
Expand Down
2 changes: 1 addition & 1 deletion driver-adapters/planetscale-node-basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"private": true,
"scripts": {
"test": "jest index.test.js"
"test": "NODE_OPTIONS=--experimental-vm-modules jest index.test.js"
},
"devDependencies": {
"@jest/globals": "29.7.0",
Expand Down
4 changes: 2 additions & 2 deletions driver-adapters/tidb-node-basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"private": true,
"scripts": {
"test": "jest index.test.js"
"test": "NODE_OPTIONS=--experimental-vm-modules jest index.test.js"
},
"devDependencies": {
"@jest/globals": "29.7.0",
Expand All @@ -12,7 +12,7 @@
},
"dependencies": {
"@prisma/client": "6.15.0-dev.25",
"@tidbcloud/prisma-adapter": "git://github.com/jacek-prisma/tidbcloud-prisma-adapter#787abe9",
"@tidbcloud/prisma-adapter": "git://github.com/jacek-prisma/tidbcloud-prisma-adapter#f30891f",
"@tidbcloud/serverless": "0.2.0"
}
}
27 changes: 15 additions & 12 deletions driver-adapters/tidb-node-basic/pnpm-lock.yaml

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

2 changes: 1 addition & 1 deletion driver-adapters/turso-node-basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"private": true,
"scripts": {
"test": "jest index.test.js"
"test": "NODE_OPTIONS=--experimental-vm-modules jest index.test.js"
},
"devDependencies": {
"@jest/globals": "29.7.0",
Expand Down
7 changes: 5 additions & 2 deletions driver-adapters/turso-web-lambda-basic/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,11 @@ GENERATED_CLIENT=$(node -e "
")

pnpm esbuild index.js --bundle --platform=node --target=node18 --outfile=dist/index.js --format=cjs
cp "$GENERATED_CLIENT"/libquery_engine-rhel-openssl-1.0.x.so.node dist
cp "$GENERATED_CLIENT"/schema.prisma dist
QUERY_ENGINE_LIB="$GENERATED_CLIENT/libquery_engine-rhel-openssl-1.0.x.so.node"
if [ -f "$QUERY_ENGINE_LIB" ]; then
cp "$QUERY_ENGINE_LIB" dist
fi
cp "$GENERATED_CLIENT/schema.prisma" dist
zip -rj lambda.zip dist

aws lambda update-function-configuration --function-name driver-adapters-turso-lambda-basic --runtime nodejs18.x --environment "Variables={DRIVER_ADAPTERS_TURSO_LAMBDA_BASIC_DATABASE_URL=$DRIVER_ADAPTERS_TURSO_LAMBDA_BASIC_DATABASE_URL,DRIVER_ADAPTERS_TURSO_LAMBDA_BASIC_TOKEN=$DRIVER_ADAPTERS_TURSO_LAMBDA_BASIC_TOKEN}" --timeout 30
Expand Down
2 changes: 1 addition & 1 deletion driver-adapters/turso-web-node-basic/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "0.1.0",
"private": true,
"scripts": {
"test": "jest index.test.js"
"test": "NODE_OPTIONS=--experimental-vm-modules jest index.test.js"
},
"devDependencies": {
"@jest/globals": "29.7.0",
Expand Down
Loading