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(libquery): remove unused code #4524

Closed
wants to merge 5 commits into from
Closed

Conversation

jkomyno
Copy link
Contributor

@jkomyno jkomyno commented Dec 5, 2023

This PR removes unused code from query-engine-node-api and query-engine-wasm.

This PR contributes to https://github.com/prisma/team-orm/issues/692.

/integration

@jkomyno jkomyno added this to the 5.8.0 milestone Dec 5, 2023
Copy link

codspeed-hq bot commented Dec 5, 2023

CodSpeed Performance Report

Merging #4524 will not alter performance

Comparing feat/clean-up-libquery (55f2ec0) with main (47a3fbd)

Summary

✅ 11 untouched benchmarks

jkomyno added a commit that referenced this pull request Dec 15, 2023
jkomyno added a commit that referenced this pull request Dec 18, 2023
…ne-node-api` and `query-engine-wasm` (#4521)

* feat(quaint): allow wasm32-unknown-unknown compilation; currently fails on native

* feat(quaint): split postgres connector into native and wasm submodules

* feat(quaint): split mysql connector into native and wasm submodules

* feat(quaint): recover wasm error for mysql

* feat(quaint): split mssql connector into native and wasm submodules

* feat(quaint): split sqlite connector into native and wasm submodules

* chore(quaint): fix clippy when compiling natively

* chore(quaint): fix clippy when compiling to wasm32-unknown-unknown

* chore(quaint): update README

* chore(quaint): rename "*-connector" feature flag to "*-native"

* feat(quaint): enable pure Wasm SqliteError

* feat(query-connect): allow wasm32-unknown-unknown compilation

* feat(sql-query-connector): allow wasm32-unknown-unknown compilation

* chore(query-engine-wasm): add currently unused local crates to test wasm32-unknown-unknown compilation

* chore: update Cargo.lock

* chore: remove leftover comments

* feat(query-core): allow wasm32-unknown-unknown compilation

* chore(sql-query-connector): fix clipppy on wasm32

* chore: remove leftover comment

* chore: remove leftover comment

* feat(driver-adapters): enable Wasm on request-handlers

* WIP: refactor mysql module to flatten its structure

* feat(quaint): flatten mssql connector module

* feat(quaint): flatten postgres connector module

* feat(quaint): flatten sqlite connector module

* chore(quaint): export all public definitions in connector "url" modules

* chore(quaint): refactor tests for connectors, addressing feedback

* chore: add comment on MysqlAsyncError

* chore: add comment on ffi.rs for sqlite

* chore: replace awkward "super::super::" with "crate::..."

* chore: add comments around "query_core::executor::task"

* chore: add comments around "query_core::executor::task"

* chore: add "request-handlers" to "query-engine-wasm"

* chore: add wasm dependencies to Cargo workspace

* feat(driver-adapters): move napi-specific code into "napi" module, prepare empty "wasm" module

* feat(driver-adapters): extracted platform-agnostic "DriverAdapterError" into "driver_adapters::error"

* chore(driver-adapters): add "driver-adapters" to "query-engine-wasm"

* feat(driver-adapters): add Wasm-specific "async_js_function"

* feat(driver-adapters): extracted common types to "driver_adapters::types"

* feat(driver-adapters): extracted "TryFrom<JSResultSet> for QuaintResultSet" to "driver_adapters::conversion::js_to_quaint"

* feat(driver-adapters): allow feature-complete Wasm compilation of "driver-adapters"

* feat(driver-adapters): plug "driver-adapters" to "query-engine-wasm"

* chore: remove .cargo, add it to .gitignore

* chore: move "task" module into its own file

* fix(driver-adapters): ci for "request-handlers"

* fix(driver-adapters): ci for "request-handlers"

* fix(driver-adapters): clippy compile error on "query-engine-wasm"

* chore(driver-adapters): fix conflicting library name warning on "cargo build"

* chore: fix conflicts

* chore: fixed some clippy warnings

* chore: add .cargo to .gitignore

* feat(query-engine-wasm): ported some logic from query-engine-node-api in a wasm32-compatible fashion

* Add connect/disconnect

* fix: remove tokio-induced panic in "connect"

* feat: remove ducktor

* feat(driver-adapters): remove "queryable" into its own module

* Couple of fixes

1. Build schema and connect sequentually
2. Print full stacktrace for WASM error
3. Expand example to attempt a query

* Fix `Instant::now` usage

Replace `Instant::now` with a custom library, that will use appriate
time/date functions for the platforms. For native, it is `std::time`,
for WASM in should probably be `performance::now()` but it is a no-op
stub for now.

* fix(driver-adapters): understand "flavour" and adjust casing in "JSResultSet"

* feat(driver-adapters): add some Into traits for "JsResult"

* Fix JSResult parsing

* Reorganize example

Switch to sqlite so cloud services are not required
Save schema to external file

* Fix some of the warnings

* Remove unused file

* Fix WASM transaction binding

Correctly gets to a point of starting the tranasction and executing the
query, fails on parsing the results like normal queries do.

* Cleanup

* feat(driver-adapters): fix enum parsing, add "wasm-rs-dbg" crate for dev development

* chore(driver-adapters): remove unused "src/wasm/queryable.rs"

* chore(driver-adapters): add "createOne" and "driverAdapters" preview feature to example

* chore(driver-adapters): add wasm-bindgen-test example

* chore(driver-adapters): update Cargo.lock

* Handle non-promise return values

* Run tests on WASM

* feat(core): allow Drop'ing futures running in loop in wasm32-* via controlled spawns

* feat(chore): add Arc<DriverAdapter> comment

* feat(chore): re-enable previous "disconnect()"

* feat(chore): update example.js

* fix(query-engine-node-api): fix compilation errors

* Update cuid

* Remove one more isntant usage

* chore(driver-adapters): simplify async_js_function API

* chore(driver-adapters): unify napi/wasm errors into "crate::JsResult"

* chore(driver-adapters): continue unifying napi/wasm functions

* chore(driver-adapters): unify napi/wasm logic for proxy

* chore(driver-adapters): unify napi/wasm logic queryable.rs and proxy.rs

* chore(driver-adapters): unify napi/wasm logic for transaction.rs

* chore(driver-adapters): clippy fixes

* chore(driver-adapters): cli
ppy fixes

* chore: remove dbg! output

* chore: remove dbg! output

* Fix itx panic

* Remove unused import

* Fix hanging itx

* fix insta tests

Strictly speaking, not related to wasm engine at all - we bumped `insta`
at some point and that required adding `allow_duplicates` macro around
the loop.

Close prisma/team-orm#651

* feat(query-engine-wasm): enable tracing and bits of telemetry

* chore: clippy

* Fix panic kills running engine in query-engine-tests (#4499)

* I didn't have wasm-pack installed, let's fix that

* Update wasm-bindgen-futures to 0.4.39

This includes rustwasm/wasm-bindgen#3203 that use queueMicrotask
to transalate spawn_local rust code.

This has fixed rustwasm/wasm-bindgen#2392 which was an issue about not being able to catch async wasm traps. This might (or not) have an effect on the issue we are trying to solve in here.

* Revert "Update wasm-bindgen-futures to 0.4.39"

This reverts commit 9a494dc.

* Restart executor when it dies

* Document Restartable

* Remove async_panic_to_js_error in WASM query engine

* Rename p -> process

* Use tokio::sync::RwLock rather than futures::lock::Mutex

* Better error messaging

* Fixing clippy

* Exclude unit tests for wasm32 when compiling the binary for other architectures

* Fix duplicate snapshots in json_filters test

* Size low hanging fruits

Removes following functionality from WASM engine:
- GraphQL protocol
- DMMF
- SDL Schema

Neither of the features are used by the client runtimes and thrid party
clients don't and can not use WASM engine, so it is safe to remove.

* feat(driver-adapters): serialize empty values as "null" rather than "undefined"

* chore: fixed query-engine-node-api build

* chore: bumped wasm-bindgen version to 0.2.89

* chore: clean up quaint transitive dependencies

* chore: removed wasm.rs test

* chore: removed temporary wasm machinery

* chore: fix clippy

* chore: remove unwrap from "sleep"

* chore: revert unnecessary psl change

* chore(driver-adapters): fix unit tests

* chore(driver-adapters): add clippy check for wasm32

* chore(driver-adapters): add clippy check for wasm32

* chore: fix clippy

* Revert "chore: removed wasm.rs test"

This reverts commit 60b0d8c.

* test(driver-adapters): add byte tests for conversion

* Revert "Revert "chore: removed wasm.rs test""

This reverts commit 481ba65.

* [skip ci] chore: fix build CI check logic

* Revert "[skip ci] chore: fix build CI check logic"

This reverts commit 28c6ff9.

* Stop using removed method

* Fix broken JS

* chore(review): rename threadsafe_fn to fn_

* chore(review): add comment related to js_sys::Reflect in JsObjectExtern

* chore(review): rename SendFuture to UnsafeFuture, improving comments

* chore(review): use fully-specialized types for wasm/napi-specific logic, when possible; apply clippy fixes

* chore(review): rename JsResult into AdapterResult, reduce duplication, improve comments

* chore(review): remove redudant full type qualifier

* chore(review): revert changes to psl-core

* chore(review): improve comments on js.rs

* Test fixes for NAPI tests (#4515)

* chore(review): comment on spawn_controlled actors, add error tracing to unexpected case

* chore(review): remove unused dependency

* chore(review): move wasm/napi-specific task JoinHandle stuff to crosstarget-utils

* feat(query-engine-common): reduce duplicated code between "query-engine-wasm" and "query-engine-node-api"

* qe-wasm: Partially fix tests (#4517)

* qe-wasm: Partially fix the test suite

1. Bash script for build did not abort on error, hence sed error on
   linux went unnoticed.
2. We don't actually need sed trickery sincce `wasm-pack` has a flag for
   changing binary name.
3. `tracing` feature does not actually work on WASM even partially: it panics on
   `Instant` invokation as soon as first span is created. Since we are
   running tests with all preview features enabled, that means that
   practically any test panics now. Disabled it again.

A lot of tests are still failing on ThreadRng invocation and stacktrace
is not really helpful, but I still think it's better if we get it
working.

* Update query-engine/query-engine-wasm/build.sh

* qe-wasm: Fix RNG on Node 18 in a test runner (#4526)

* feat(query-engine-common): move more stuff to "query-engine-common"

* feat: limit the number of conditional flags for each native-only struct field by introducing *Native structs conditionally

* feat: remove unused code (supersedes #4524)

---------

Co-authored-by: Miguel Fernandez <miguel@mff.io>
Co-authored-by: Sergey Tatarintsev <tatarintsev@prisma.io>
Co-authored-by: Jan Piotrowski <piotrowski+github@gmail.com>
Co-authored-by: Miguel Fernández <fernandez@prisma.io>
@jkomyno
Copy link
Contributor Author

jkomyno commented Dec 18, 2023

Deprecated by #4521.

@jkomyno jkomyno closed this Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant