Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(neon-http): uncomment .delete() #4946

Draft
wants to merge 20 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 18 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
20 changes: 10 additions & 10 deletions driver-adapters-wasm/neon-http-cf-basic/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,13 @@ test('prisma version and output', async () => {
`)
// expect(regResult.updateMany.count).toBe(1)
expect(regResult.findFirst).toMatchInlineSnapshot(`null`)
// expect(regResult.delete).toMatchInlineSnapshot(`
// {
// "age": 27,
// "email": "[email protected]",
// "name": "Test 1",
// }
// `)
expect(regResult.delete).toMatchInlineSnapshot(`
{
"age": 27,
"email": "[email protected]",
"name": "Test 1",
}
`)
expect(regResult.count).toBe(1)
expect(regResult.aggregate).toMatchInlineSnapshot(`
{
Expand All @@ -105,9 +105,9 @@ test('prisma version and output', async () => {
`)
expect(regResult.findUniqueOrThrow).toMatchInlineSnapshot(`
{
"age": 26,
"email": "test-1@prisma.io",
"name": "Test 1",
"age": 29,
"email": "test-2@prisma.io",
"name": "Test 2",
}
`)
// expect(regResult.upsert).toMatchInlineSnapshot(`
Expand Down
36 changes: 25 additions & 11 deletions driver-adapters-wasm/neon-http-cf-basic/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,20 @@ export default {
name: true,
},
}),
// Since `createMany` does not work we add a second create
// the record is used for `findUniqueOrThrow(...)` below
create2: await prisma.user.create({
data: {
email: `[email protected]`,
age: 29,
name: 'Test 2',
},
select: {
email: true,
age: true,
name: true,
},
Jolg42 marked this conversation as resolved.
Show resolved Hide resolved
}),
// Expected to fail in HTTP mode
// createMany: await prisma.user.createMany({
// data: [
Expand Down Expand Up @@ -114,16 +128,16 @@ export default {
name: true,
},
}),
// delete: await prisma.user.delete({
// where: {
// email: '[email protected]',
// },
// select: {
// email: true,
// age: true,
// name: true,
// },
// }),
delete: await prisma.user.delete({
where: {
email: '[email protected]',
},
select: {
email: true,
age: true,
name: true,
},
}),
count: await prisma.user.count(),
aggregate: await prisma.user
.aggregate({
Expand Down Expand Up @@ -155,7 +169,7 @@ export default {
}),
findUniqueOrThrow: await prisma.user.findUniqueOrThrow({
where: {
email: 'test-1@prisma.io',
email: 'test-2@prisma.io',
},
select: {
age: true,
Expand Down
20 changes: 10 additions & 10 deletions driver-adapters-wasm/neon-http-vercel-nextjs-edgemw/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,13 @@ test('prisma version and output', async () => {
`)
// expect(regResult.updateMany.count).toBe(1)
expect(regResult.findFirst).toMatchInlineSnapshot(`null`)
// expect(regResult.delete).toMatchInlineSnapshot(`
// {
// "age": 27,
// "email": "[email protected]",
// "name": "Test 1",
// }
// `)
expect(regResult.delete).toMatchInlineSnapshot(`
{
"age": 27,
"email": "[email protected]",
"name": "Test 1",
}
`)
expect(regResult.count).toBe(1)
expect(regResult.aggregate).toMatchInlineSnapshot(`
{
Expand All @@ -115,9 +115,9 @@ test('prisma version and output', async () => {
`)
expect(regResult.findUniqueOrThrow).toMatchInlineSnapshot(`
{
"age": 26,
"email": "test-1@prisma.io",
"name": "Test 1",
"age": 29,
"email": "test-2@prisma.io",
"name": "Test 2",
}
`)
// expect(regResult.upsert).toMatchInlineSnapshot(`
Expand Down
31 changes: 20 additions & 11 deletions driver-adapters-wasm/neon-http-vercel-nextjs-edgemw/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ async function getResponse() {
name: true,
},
}),
// Since `createMany` does not work we add a second create
// the record is used for `findUniqueOrThrow(...)` below
create2: await prisma.user.create({
Jolg42 marked this conversation as resolved.
Show resolved Hide resolved
data: {
email: `[email protected]`,
age: 29,
name: 'Test 2',
}
}),
// Expected to fail in HTTP mode
// createMany: await prisma.user.createMany({
// data: [
Expand Down Expand Up @@ -114,16 +123,16 @@ async function getResponse() {
name: true,
},
}),
// delete: await prisma.user.delete({
// where: {
// email: '[email protected]',
// },
// select: {
// email: true,
// age: true,
// name: true,
// },
// }),
delete: await prisma.user.delete({
where: {
email: '[email protected]',
},
select: {
email: true,
age: true,
name: true,
},
}),
count: await prisma.user.count(),
aggregate: await prisma.user
.aggregate({
Expand Down Expand Up @@ -155,7 +164,7 @@ async function getResponse() {
}),
findUniqueOrThrow: await prisma.user.findUniqueOrThrow({
where: {
email: 'test-1@prisma.io',
email: 'test-2@prisma.io',
},
select: {
age: true,
Expand Down
36 changes: 25 additions & 11 deletions driver-adapters/neon-http-lambda-basic/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,20 @@ exports.handler = async () => {
name: true,
},
}),
// Since `createMany` does not work we add a second create
// the record is used for `findUniqueOrThrow(...)` below
create2: await prisma.user.create({
Jolg42 marked this conversation as resolved.
Show resolved Hide resolved
data: {
email: `[email protected]`,
age: 29,
name: 'Test 2',
},
select: {
email: true,
age: true,
name: true,
},
Jolg42 marked this conversation as resolved.
Show resolved Hide resolved
}),
// Expected to fail in HTTP mode
// createMany: await prisma.user.createMany({
// data: [
Expand Down Expand Up @@ -115,16 +129,16 @@ exports.handler = async () => {
name: true,
},
}),
// delete: await prisma.user.delete({
// where: {
// email: '[email protected]',
// },
// select: {
// email: true,
// age: true,
// name: true,
// },
// }),
delete: await prisma.user.delete({
where: {
email: '[email protected]',
},
select: {
email: true,
age: true,
name: true,
},
}),
count: await prisma.user.count(),
aggregate: await prisma.user
.aggregate({
Expand Down Expand Up @@ -156,7 +170,7 @@ exports.handler = async () => {
}),
findUniqueOrThrow: await prisma.user.findUniqueOrThrow({
where: {
email: 'test-1@prisma.io',
email: 'test-2@prisma.io',
},
select: {
age: true,
Expand Down
14 changes: 7 additions & 7 deletions driver-adapters/neon-http-lambda-basic/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@ test('prisma version and output', async () => {
`)
// expect(regResult.updateMany.count).toBe(1)
expect(regResult.findFirst).toMatchInlineSnapshot(`null`)
// expect(regResult.delete).toMatchInlineSnapshot(`
// {
// "age": 27,
// "email": "[email protected]",
// "name": "Test 1",
// }
// `)
expect(regResult.delete).toMatchInlineSnapshot(`
{
"age": 27,
"email": "[email protected]",
"name": "Test 1",
}
`)
expect(regResult.count).toBe(1)
expect(regResult.aggregate).toMatchInlineSnapshot(`
{
Expand Down
22 changes: 11 additions & 11 deletions driver-adapters/neon-http-node-basic/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,16 +115,16 @@ exports.handler = async () => {
name: true,
},
}),
// delete: await prisma.user.delete({
// where: {
// email: '[email protected]',
// },
// select: {
// email: true,
// age: true,
// name: true,
// },
// }),
delete: await prisma.user.delete({
where: {
email: '[email protected]',
},
select: {
email: true,
age: true,
name: true,
},
}),
count: await prisma.user.count(),
aggregate: await prisma.user
.aggregate({
Expand Down Expand Up @@ -156,7 +156,7 @@ exports.handler = async () => {
}),
findUniqueOrThrow: await prisma.user.findUniqueOrThrow({
where: {
email: 'test-1@prisma.io',
email: 'test-2@prisma.io',
},
select: {
age: true,
Expand Down
14 changes: 7 additions & 7 deletions driver-adapters/neon-http-node-basic/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ test('prisma version and output', async () => {
`)
// expect(regResult.updateMany.count).toBe(1)
expect(regResult.findFirst).toMatchInlineSnapshot(`null`)
// expect(regResult.delete).toMatchInlineSnapshot(`
// {
// "age": 27,
// "email": "[email protected]",
// "name": "Test 1",
// }
// `)
expect(regResult.delete).toMatchInlineSnapshot(`
{
"age": 27,
"email": "[email protected]",
"name": "Test 1",
}
`)
expect(regResult.count).toBe(1)
expect(regResult.aggregate).toMatchInlineSnapshot(`
{
Expand Down
20 changes: 10 additions & 10 deletions driver-adapters/neon-http-vercel-nextjs/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,13 @@ test('prisma version and output', async () => {
`)
// expect(regResult.updateMany.count).toBe(1)
expect(regResult.findFirst).toMatchInlineSnapshot(`null`)
// expect(regResult.delete).toMatchInlineSnapshot(`
// {
// "age": 27,
// "email": "[email protected]",
// "name": "Test 1",
// }
// `)
expect(regResult.delete).toMatchInlineSnapshot(`
{
"age": 27,
"email": "[email protected]",
"name": "Test 1",
}
`)
expect(regResult.count).toBe(1)
expect(regResult.aggregate).toMatchInlineSnapshot(`
{
Expand All @@ -119,9 +119,9 @@ test('prisma version and output', async () => {
`)
expect(regResult.findUniqueOrThrow).toMatchInlineSnapshot(`
{
"age": 26,
"email": "test-1@prisma.io",
"name": "Test 1",
"age": 29,
"email": "test-2@prisma.io",
"name": "Test 2",
}
`)
// expect(regResult.upsert).toMatchInlineSnapshot(`
Expand Down
Loading
Loading