Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4d3b606
commit abdad8a
Showing
6 changed files
with
68 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
src/packages/client/src/__tests__/integration/happy/rfc3339/.gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
!dev.db |
Binary file not shown.
31 changes: 31 additions & 0 deletions
31
src/packages/client/src/__tests__/integration/happy/rfc3339/schema.prisma
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
datasource db { | ||
provider = "sqlite" | ||
url = "file:dev.db" | ||
default = true | ||
} | ||
|
||
generator client { | ||
provider = "prisma-client-js" | ||
previewFeatures = ["groupBy"] | ||
} | ||
|
||
// / User model comment | ||
model User { | ||
id String @id @default(uuid()) | ||
email String @unique | ||
age Int | ||
// / name comment | ||
name String? | ||
posts Post[] | ||
} | ||
|
||
model Post { | ||
id String @id @default(cuid()) | ||
createdAt DateTime @default(now()) | ||
updatedAt DateTime @updatedAt | ||
published Boolean | ||
title String | ||
content String? | ||
authorId String? | ||
author User? @relation(fields: [authorId], references: [id]) | ||
} |
25 changes: 25 additions & 0 deletions
25
src/packages/client/src/__tests__/integration/happy/rfc3339/test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { getTestClient } from '../../../../utils/getTestClient' | ||
|
||
let prisma | ||
|
||
beforeAll(async () => { | ||
const PrismaClient = await getTestClient() | ||
prisma = new PrismaClient() | ||
}) | ||
|
||
afterAll(() => { | ||
prisma.$disconnect() | ||
}) | ||
|
||
test('findMany filter by rfc3339 date string', async () => { | ||
console.log('going for it') | ||
const user = await prisma.post.findMany({ | ||
where: { | ||
createdAt: { | ||
gt: '2019-01-13T12:40:47+01:00', | ||
}, | ||
}, | ||
}) | ||
|
||
expect(user).toMatchInlineSnapshot(`Array []`) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters