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

feat(client): interactive transactions #8384

Merged
merged 60 commits into from Aug 9, 2021
Merged
Show file tree
Hide file tree
Changes from 55 commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
50fb11b
feat(engine-core): add transaction capability
millsp Jul 6, 2021
ee9d267
chore(client): implement scheduler
millsp Jul 6, 2021
a8aad77
chore(client): implement $transaction async
millsp Jul 7, 2021
d463d3f
chore(client): guard lrt functionality
millsp Jul 7, 2021
a24e375
test(lrt): init first test
millsp Jul 7, 2021
d877d6c
chore(engine-core): integrate mock server
millsp Jul 8, 2021
4e78e3b
chore(client): change scheduler id gen
millsp Jul 8, 2021
77cee6a
test(client, lrt): cleanup
millsp Jul 8, 2021
a5162c3
chore(jest): allow to run specs
millsp Jul 8, 2021
27c839f
fix(client): handle http error codes
millsp Jul 8, 2021
6862fe4
refactor(client, scheduler): avoid promise anti pattern
millsp Jul 8, 2021
511a81a
chore: begin code split
millsp Jul 10, 2021
796690d
chore(client): rename dataloader
millsp Jul 10, 2021
4148f10
chore(client): rename dataloader
millsp Jul 10, 2021
d82e565
chore(client): add types for client
millsp Jul 10, 2021
701d000
chore(client, engine-core): allow headers for batching
millsp Jul 10, 2021
41cbcee
chore(client): guard for fetcher
millsp Jul 10, 2021
b9fbc31
chore(client): provide first lrt definition
millsp Jul 12, 2021
c1958e4
Merge branch 'master' of https://github.com/prisma/prisma into feat/l…
millsp Jul 12, 2021
38c1f9f
chore: update locks
millsp Jul 12, 2021
67679b5
fix(client): type gen line breaks for tx
millsp Jul 12, 2021
b23aa5c
fix(client): batching for regular tx
millsp Jul 13, 2021
28d9cf3
refactor(engine-core): organize
millsp Jul 21, 2021
1d7d5da
Merge branch 'master' of https://github.com/prisma/prisma into feat/l…
millsp Jul 21, 2021
c274b2a
Merge branch 'master' of https://github.com/prisma/prisma into feat/l…
millsp Jul 23, 2021
a21d9f8
test(client): add basic tests
millsp Jul 23, 2021
c7b7533
fix(client): forbidden methods for lrt
millsp Jul 23, 2021
0c7d3d3
fix(client): remove lrt scheduler
millsp Jul 24, 2021
7c74a95
chore(prisma)! integrate engines
millsp Jul 30, 2021
e5159fc
chore: debug
millsp Jul 30, 2021
63d2cd5
chore: pkg lock
millsp Jul 30, 2021
799d38b
chore(scripts): fix bump engines
millsp Jul 30, 2021
a95d283
chore(client): integrate with engines
millsp Jul 31, 2021
5b3759f
chore(client); use lrt flag
millsp Jul 31, 2021
54cc215
Merge branch 'master' of https://github.com/prisma/prisma into feat/l…
millsp Jul 31, 2021
563b1e0
chore: pnpm lock
millsp Jul 31, 2021
5e1a9c8
test(engine-core): fix imports
millsp Jul 31, 2021
5e0b9a8
chore(client): handle lrt errors
millsp Jul 31, 2021
a845dad
fix(client): restore missing cond
millsp Jul 31, 2021
7cba5bd
chore(prisma): prepare merge
millsp Aug 5, 2021
6a3dee5
Merge branch 'main' into feat/long-running-transactions
millsp Aug 6, 2021
2f5de03
chore(engine-core): lint
millsp Aug 6, 2021
cb6a71c
chore(client): rename to interactive transactions
millsp Aug 6, 2021
6dd2f82
chore(prisma): bump engines
millsp Aug 6, 2021
3055bd1
test(client): rename interactive tx
millsp Aug 6, 2021
c8ba24b
chore(client): begin itx impl for library
millsp Aug 6, 2021
a194656
feat(client, itx): node api
millsp Aug 6, 2021
01379f4
Merge branch 'main' of https://github.com/prisma/prisma into feat/lon…
millsp Aug 6, 2021
0f9f479
chore: update locks
millsp Aug 6, 2021
3f677ba
test(client, itx): add missing await
millsp Aug 6, 2021
6641a48
test(client, itx): fix race condition with timeout
millsp Aug 6, 2021
84910b6
test(client, itx): disable nested
millsp Aug 7, 2021
befca0a
test(client, itx): add skipped test for maxWait
millsp Aug 7, 2021
b66e2d0
fix(client, itx): types for options
millsp Aug 7, 2021
1326839
fix(client, itx): line break type gen
millsp Aug 7, 2021
271ab26
chore(prisma): review cleanup
millsp Aug 9, 2021
cfac306
chore(prisma): review cleanup
millsp Aug 9, 2021
96d34f2
Merge branch 'main' of https://github.com/prisma/prisma into feat/lon…
millsp Aug 9, 2021
94cd6c6
chore(prisma): bump engines
millsp Aug 9, 2021
ecdd3e2
Merge remote-tracking branch 'origin/main' into feat/long-running-tra…
millsp Aug 9, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/cli/package.json
Expand Up @@ -63,9 +63,9 @@
"devDependencies": {
"@prisma/client": "workspace:*",
"@prisma/debug": "workspace:*",
"@prisma/fetch-engine": "2.29.0-25.f1238e20399c9d3dc91301ebca69230503301f6e",
"@prisma/fetch-engine": "2.29.0-27.query-engine-lrts-4e355054bff7d6c7c018a5bf5c3883d13069ffb8",
"@prisma/generator-helper": "workspace:*",
"@prisma/get-platform": "2.29.0-25.f1238e20399c9d3dc91301ebca69230503301f6e",
"@prisma/get-platform": "2.29.0-27.query-engine-lrts-4e355054bff7d6c7c018a5bf5c3883d13069ffb8",
"@prisma/migrate": "workspace:*",
"@prisma/sdk": "workspace:*",
"@prisma/studio-server": "0.418.0",
Expand Down Expand Up @@ -127,7 +127,7 @@
"precommit": "lint-staged"
},
"dependencies": {
"@prisma/engines": "2.29.0-25.f1238e20399c9d3dc91301ebca69230503301f6e"
"@prisma/engines": "2.29.0-27.query-engine-lrts-4e355054bff7d6c7c018a5bf5c3883d13069ffb8"
},
"lint-staged": {
"*.ts": [
Expand Down
24 changes: 12 additions & 12 deletions packages/client/jest.config.js
Expand Up @@ -5,23 +5,23 @@ module.exports = {
coverageReporters: ['clover'],
coverageDirectory: 'src/__tests__/coverage',
modulePathIgnorePatterns: [
'build/',
'dist/',
'generator/',
'runtime/',
'@prisma',
'<rootDir>/dist/',
'<rootDir>/fixtures/',
'<rootDir>/generator-build/',
'<rootDir>/runtime/',
'<rootDir>/runtime-dist/',
'<rootDir>/sandbox/',
'<rootDir>/scripts/',
'<rootDir>/src/__tests__/benchmarks/',
'<rootDir>/src/__tests__/types/.*/test.ts',
'<rootDir>/src/__tests__/integration/happy/exhaustive-schema/generated-dmmf.ts',
'__helpers__/',
'node_modules/',
'index.ts',
'index.d.ts',
'index.js',
'index.test-d.ts',
'.bench.ts',
'__tests__/benchmarks/',
'__tests__/types/.*/test.ts',
'stack.js',
'runner.js',
'node_modules/',
'exhaustive-schema/generated-dmmf.ts',
'__helpers__',
],
collectCoverageFrom: ['src/**/*.ts', '!**/__tests__/**/*'],
snapshotSerializers: ['./helpers/jestSnapshotSerializer'],
Expand Down
8 changes: 4 additions & 4 deletions packages/client/package.json
Expand Up @@ -61,10 +61,10 @@
"devDependencies": {
"@prisma/debug": "workspace:*",
"@prisma/engine-core": "workspace:*",
"@prisma/engines": "2.29.0-25.f1238e20399c9d3dc91301ebca69230503301f6e",
"@prisma/fetch-engine": "2.29.0-25.f1238e20399c9d3dc91301ebca69230503301f6e",
"@prisma/engines": "2.29.0-27.query-engine-lrts-4e355054bff7d6c7c018a5bf5c3883d13069ffb8",
"@prisma/fetch-engine": "2.29.0-27.query-engine-lrts-4e355054bff7d6c7c018a5bf5c3883d13069ffb8",
"@prisma/generator-helper": "workspace:*",
"@prisma/get-platform": "2.29.0-25.f1238e20399c9d3dc91301ebca69230503301f6e",
"@prisma/get-platform": "2.29.0-27.query-engine-lrts-4e355054bff7d6c7c018a5bf5c3883d13069ffb8",
"@prisma/migrate": "workspace:*",
"@prisma/sdk": "workspace:*",
"@timsuchanek/copy": "1.4.5",
Expand Down Expand Up @@ -128,7 +128,7 @@
}
},
"dependencies": {
"@prisma/engines-version": "2.29.0-25.f1238e20399c9d3dc91301ebca69230503301f6e"
"@prisma/engines-version": "2.29.0-27.query-engine-lrts-4e355054bff7d6c7c018a5bf5c3883d13069ffb8"
},
"lint-staged": {
"*.ts": [
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/__tests__/binaryEngine.test.ts
@@ -1,4 +1,4 @@
import { BinaryEngine } from '@prisma/engine-core/dist/BinaryEngine'
import { BinaryEngine } from '@prisma/engine-core'
import path from 'path'

describe('BinaryEngine', () => {
Expand Down
@@ -0,0 +1 @@
!dev.db
Binary file not shown.
@@ -0,0 +1,29 @@
datasource db {
provider = "sqlite"
url = "file:dev.db"
}

generator client {
provider = "prisma-client-js"
previewFeatures = ["interactiveTransactions"]
}

// / User model comment
model User {
id String @id @default(uuid())
email String @unique
// / 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])
}