Skip to content

Commit ebaf26a

Browse files
committed
chore: remove query engine (#5685)
Remove the top level QE crates, SQL query connector and QE-specific code from `query-core`, and move the crates used by QC to the `query-compiler` directory. Also removes the Node-API specific code from `driver-adapters` and leaves only the Wasm implementation to be used by `schema-engine-wasm`. Unused MongoDB query connector is left for future reference as we are going to be porting that logic to QC. Required for #5683. Closes: https://linear.app/prisma-company/issue/TML-1554/remove-query-engine-from-prisma-engines Ref: prisma/prisma#28375 /prisma-branch next
1 parent 3d8db83 commit ebaf26a

511 files changed

Lines changed: 873 additions & 21759 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.envrc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ export QE_LOG_LEVEL=debug # Set it to "trace" to enable query-graph debugging lo
2020
export FMT_SQL=1 # Uncomment it to enable logging formatted SQL queries
2121

2222
### Uncomment to run driver adapters tests. See query-engine-driver-adapters.yml workflow for how tests run in CI.
23-
# export EXTERNAL_TEST_EXECUTOR="napi"
2423
# export DRIVER_ADAPTER=pg # Set to pg, neon, planetscale, libsql or cfd1
2524
# export PRISMA_DISABLE_QUAINT_EXECUTORS=1 # Disable quaint executors for driver adapters
2625
# export DRIVER_ADAPTER_URL_OVERRIDE ="postgres://USER:PASSWORD@DATABASExxxx" # Override the database url for the driver adapter tests

.github/workflows/build-engines-apple-intel-template.yml

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,24 +39,11 @@ jobs:
3939
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
4040

4141
- run: |
42-
cargo build --release -p query-engine -p query-engine-node-api -p schema-engine-cli -p prisma-fmt
43-
44-
- name: Rename files
45-
working-directory: ${{ github.workspace }}/target/release/
46-
run: |
47-
echo "Files in target/release before renaming"
48-
ls -la .
49-
50-
mv libquery_engine.dylib libquery_engine.dylib.node
51-
52-
echo "Files in target/release after renaming"
53-
ls -la .
42+
cargo build --release -p schema-engine-cli -p prisma-fmt
5443
5544
- uses: actions/upload-artifact@v4
5645
with:
5746
name: darwin
5847
path: |
5948
${{ github.workspace }}/target/release/schema-engine
6049
${{ github.workspace }}/target/release/prisma-fmt
61-
${{ github.workspace }}/target/release/query-engine
62-
${{ github.workspace }}/target/release/libquery_engine.dylib.node

.github/workflows/build-engines-apple-silicon-template.yml

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,24 +38,11 @@ jobs:
3838
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
3939

4040
- run: |
41-
cargo build --target=aarch64-apple-darwin --release -p query-engine -p query-engine-node-api -p schema-engine-cli -p prisma-fmt
42-
43-
- name: Rename files
44-
working-directory: ${{ github.workspace }}/target/aarch64-apple-darwin/release
45-
run: |
46-
echo "Files in target/release before renaming"
47-
ls -la .
48-
49-
mv libquery_engine.dylib libquery_engine.dylib.node
50-
51-
echo "Files in target/release after renaming"
52-
ls -la .
41+
cargo build --target=aarch64-apple-darwin --release -p schema-engine-cli -p prisma-fmt
5342
5443
- uses: actions/upload-artifact@v4
5544
with:
5645
name: darwin-arm64
5746
path: |
5847
${{ github.workspace }}/target/aarch64-apple-darwin/release/schema-engine
5948
${{ github.workspace }}/target/aarch64-apple-darwin/release/prisma-fmt
60-
${{ github.workspace }}/target/aarch64-apple-darwin/release/query-engine
61-
${{ github.workspace }}/target/aarch64-apple-darwin/release/libquery_engine.dylib.node

.github/workflows/build-engines-linux-template.yml

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -131,31 +131,19 @@ jobs:
131131
TARGET_NAME: ${{ matrix.target.name }}
132132
RELEASE_DIR: ${{ github.workspace }}/target/release
133133
run: |
134-
echo "Files in target/release before renaming"
134+
echo "Files in target/release"
135135
ls -la $RELEASE_DIR
136136
137137
echo "Copying files to engines-artifacts"
138138
cp -r $RELEASE_DIR/ engines-artifacts
139139
140-
echo "Rename libquery_engine.so to libquery_engine.so.node for non-static targets"
141-
if [[ "$TARGET_NAME" == *-static-* ]]; then
142-
echo "Current target is static. Skipping."
143-
else
144-
mv engines-artifacts/libquery_engine.so engines-artifacts/libquery_engine.so.node
145-
fi
146-
147-
echo "Files in engines-artifacts after renaming"
148-
ls -la engines-artifacts
149-
150140
- name: Upload artifacts for "release" target
151141
uses: actions/upload-artifact@v4
152142
if: ${{ matrix.target.target_path == '' }}
153143
with:
154144
name: '${{ matrix.target.name }}'
155145
path: |
156-
${{ github.workspace }}/engines-artifacts/libquery_engine.so.node
157146
${{ github.workspace }}/engines-artifacts/schema-engine
158-
${{ github.workspace }}/engines-artifacts/query-engine
159147
${{ github.workspace }}/engines-artifacts/prisma-fmt
160148
161149
- name: Prepare files for "${{ matrix.target.name }}" target
@@ -164,29 +152,17 @@ jobs:
164152
TARGET_NAME: ${{ matrix.target.name }}
165153
RELEASE_DIR: ${{ github.workspace }}/target/${{ matrix.target.target_path }}/release
166154
run: |
167-
echo "Files in target/release before renaming"
155+
echo "Files in target/release"
168156
ls -la $RELEASE_DIR
169157
170158
echo "Copying files to engines-artifacts"
171159
cp -r $RELEASE_DIR/ engines-artifacts
172160
173-
echo "Rename libquery_engine.so to libquery_engine.so.node for non-static targets"
174-
if [[ "$TARGET_NAME" == *-static-* ]]; then
175-
echo "Current target is static. Skipping."
176-
else
177-
mv engines-artifacts/libquery_engine.so engines-artifacts/libquery_engine.so.node
178-
fi
179-
180-
echo "Files in engines-artifacts after renaming"
181-
ls -la engines-artifacts
182-
183161
- name: Upload artifacts for "${{ matrix.target.name }}" target
184162
uses: actions/upload-artifact@v4
185163
if: ${{ matrix.target.target_path != '' }}
186164
with:
187165
name: ${{ matrix.target.name }}
188166
path: |
189-
${{ github.workspace }}/engines-artifacts/libquery_engine.so.node
190167
${{ github.workspace }}/engines-artifacts/schema-engine
191-
${{ github.workspace }}/engines-artifacts/query-engine
192168
${{ github.workspace }}/engines-artifacts/prisma-fmt

.github/workflows/build-engines-react-native-template.yml

Lines changed: 0 additions & 102 deletions
This file was deleted.

.github/workflows/build-engines-windows-template.yml

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -38,25 +38,11 @@ jobs:
3838

3939
- uses: actions-rust-lang/setup-rust-toolchain@v1
4040

41-
- run: cargo build --release -p query-engine -p query-engine-node-api -p schema-engine-cli -p prisma-fmt
42-
43-
- name: Rename files
44-
working-directory: ${{ github.workspace }}/target/release/
45-
run: |
46-
echo "Files in target/release before renaming"
47-
ls .
48-
49-
mv query_engine.dll query_engine.dll.node
50-
mv query-engine.exe query-engine.exe
51-
52-
echo "Files in target/release after renaming"
53-
ls .
41+
- run: cargo build --release -p schema-engine-cli -p prisma-fmt
5442

5543
- uses: actions/upload-artifact@v4
5644
with:
5745
name: windows
5846
path: |
5947
${{ github.workspace }}/target/release/prisma-fmt.exe
6048
${{ github.workspace }}/target/release/schema-engine.exe
61-
${{ github.workspace }}/target/release/query-engine.exe
62-
${{ github.workspace }}/target/release/query_engine.dll.node

.github/workflows/build-engines.yml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -162,15 +162,6 @@ jobs:
162162
with:
163163
commit: ${{ github.sha }}
164164

165-
build-react-native:
166-
name: Build Engines for React native
167-
needs:
168-
- is-release-necessary
169-
if: ${{ needs.is-release-necessary.outputs.release == 'true' }}
170-
uses: ./.github/workflows/build-engines-react-native-template.yml
171-
with:
172-
commit: ${{ github.sha }}
173-
174165
build-windows:
175166
name: Build Engines for Windows
176167
needs:
@@ -189,7 +180,6 @@ jobs:
189180
- build-linux
190181
- build-macos-intel
191182
- build-macos-silicon
192-
- build-react-native
193183
- build-windows
194184
env:
195185
BUCKET_NAME: 'prisma-builds'
@@ -250,13 +240,6 @@ jobs:
250240
cp -r rhel-openssl-1.1.x debian-openssl-1.1.x
251241
cp -r rhel-openssl-3.0.x debian-openssl-3.0.x
252242
253-
- name: Create .zip for react-native
254-
working-directory: engines-artifacts
255-
run: |
256-
mkdir react-native
257-
zip -r react-native/binaries.zip ios android
258-
rm -rf ios android
259-
260243
- name: 'Create compressed engine files (.gz)'
261244
working-directory: engines-artifacts
262245
run: |

.github/workflows/codspeed.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: 'QE: Codespeed benchmarks'
1+
name: 'QC: Codespeed benchmarks'
22
on:
33
push:
44
branches:
@@ -28,8 +28,8 @@ jobs:
2828
- name: 'Build the benchmark targets: schema'
2929
run: cargo codspeed build -p schema --features all_connectors
3030

31-
- name: 'Build the benchmark targets: request-handlers'
32-
run: cargo codspeed build -p request-handlers --features all
31+
- name: 'Build the benchmark targets: core-tests'
32+
run: cargo codspeed build -p core-tests
3333

3434
- name: Run the benchmarks
3535
uses: CodSpeedHQ/action@v3

.github/workflows/on-push-to-main.yml

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches:
66
- main
7+
- next
78

89
concurrency:
910
group: ${{ github.workflow }}-${{ github.ref }}
@@ -21,23 +22,18 @@ jobs:
2122

2223
- uses: ./.github/workflows/include/rust-wasm-setup
2324

24-
- name: Build native engines
25-
run: |
26-
cargo build --release -p query-engine -p query-engine-node-api
27-
mv target/release/libquery_engine.{so,node}
28-
29-
- name: Build WASM engines
25+
- name: Build WASM modules
3026
env:
3127
WASM_BUILD_PROFILE: release
32-
PKG_DIR: query-engine/query-engine-wasm/pkg
33-
TARGET_DIR: target/query-engine-wasm
28+
PKG_DIR: query-compiler/query-compiler-wasm/pkg
29+
TARGET_DIR: target/query-compiler-wasm
3430
run: |
35-
make build-qe-wasm-gz
31+
make build-qc-wasm-gz
3632
mkdir -p $TARGET_DIR
3733
3834
for provider in "postgresql" "mysql" "sqlite" "sqlserver" "cockroachdb"; do
39-
cp $PKG_DIR/$provider/query_engine_bg.wasm $TARGET_DIR/query-engine-$provider.wasm
40-
cp $PKG_DIR/$provider.gz $TARGET_DIR/query-engine-$provider.wasm.gz
35+
cp $PKG_DIR/$provider/query_compiler_bg.wasm $TARGET_DIR/query-compiler-$provider.wasm
36+
cp $PKG_DIR/$provider.gz $TARGET_DIR/query-compiler-$provider.wasm.gz
4137
done
4238
4339
- name: Check out gh-pages branch
@@ -48,18 +44,16 @@ jobs:
4844
- name: Update engines size
4945
run: |
5046
files=(
51-
target/release/query-engine
52-
target/release/libquery_engine.node
53-
target/query-engine-wasm/query-engine-postgresql.wasm.gz
54-
target/query-engine-wasm/query-engine-postgresql.wasm
55-
target/query-engine-wasm/query-engine-mysql.wasm.gz
56-
target/query-engine-wasm/query-engine-mysql.wasm
57-
target/query-engine-wasm/query-engine-sqlite.wasm.gz
58-
target/query-engine-wasm/query-engine-sqlite.wasm
59-
target/query-engine-wasm/query-engine-sqlserver.wasm.gz
60-
target/query-engine-wasm/query-engine-sqlserver.wasm
61-
target/query-engine-wasm/query-engine-cockroachdb.wasm.gz
62-
target/query-engine-wasm/query-engine-cockroachdb.wasm
47+
target/query-compiler-wasm/query-compiler-postgresql.wasm.gz
48+
target/query-compiler-wasm/query-compiler-postgresql.wasm
49+
target/query-compiler-wasm/query-compiler-mysql.wasm.gz
50+
target/query-compiler-wasm/query-compiler-mysql.wasm
51+
target/query-compiler-wasm/query-compiler-sqlite.wasm.gz
52+
target/query-compiler-wasm/query-compiler-sqlite.wasm
53+
target/query-compiler-wasm/query-compiler-sqlserver.wasm.gz
54+
target/query-compiler-wasm/query-compiler-sqlserver.wasm
55+
target/query-compiler-wasm/query-compiler-cockroachdb.wasm.gz
56+
target/query-compiler-wasm/query-compiler-cockroachdb.wasm
6357
)
6458
6559
DATE_TIME="$(date -u --iso-8601=seconds)"

.github/workflows/publish-query-compiler-wasm.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
- name: Build @prisma/query-compiler-wasm
3939
run: make build-qc-wasm
4040
env:
41-
QE_WASM_VERSION: ${{ github.event.inputs.packageVersion }}
41+
QC_WASM_VERSION: ${{ github.event.inputs.packageVersion }}
4242

4343
- name: Install Node.js
4444
uses: actions/setup-node@v4

0 commit comments

Comments
 (0)