-
Notifications
You must be signed in to change notification settings - Fork 291
fix(D1): numerical filters and aggregations + emulated referential actions #4970
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
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
c9d1b37
feat(driver-adapters): add support for arg_types (Napi, Wasm) in "Query"
jkomyno b627392
test(driver-adapters): fixed D1 tests related to Int64 (de)serialisation
jkomyno 46841fc
DRIVER_ADAPTERS_BRANCH=feat/d1-arg-types retrigger CI/CD
jkomyno d742a1e
DRIVER_ADAPTERS_BRANCH=feat-d1-arg-types retrigger CI/CD
jkomyno dd8fb32
Merge branch 'main' of github.com:prisma/prisma-engines
jkomyno 286ce7b
Merge branch 'main' into integration/fix-d1-int64
jkomyno 966bb2c
chore: add logs to "Extract branch name" CI step
jkomyno 61431bb
DRIVER_ADAPTERS_BRANCH=feat/d1-arg-types chore: retrigger CI/CD
jkomyno a125647
chore: add logs to "Extract branch name" CI step
jkomyno a17704b
DRIVER_ADAPTERS_BRANCH=feat/d1-arg-types chore: retrigger CI/CD
jkomyno 372fa9b
fix: use head ref rather than merge branch to get the original commit…
jkomyno f1fdaaf
DRIVER_ADAPTERS_BRANCH=feat/d1-arg-types chore: retrigger CI/CD
jkomyno 8c92345
feat(driver-adapters): map every "QuaintValue" enum value to "JSArgType"
jkomyno 39886f4
chore(driver-adapters): use camelCase for "Query" deserialisation in …
jkomyno e5ebd17
DRIVER_ADAPTERS_BRANCH=feat/d1-arg-types chore: retrigger CI/CD
jkomyno 1ba2653
feat(driver-adapters): discard the optionality in JSArgType, simplify…
jkomyno 3fe108c
DRIVER_ADAPTERS_BRANCH=feat/d1-arg-types chore: retrigger CI/CD
jkomyno File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
93 changes: 93 additions & 0 deletions
93
query-engine/driver-adapters/src/conversion/js_arg_type.rs
This file contains hidden or 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,93 @@ | ||
| /// `JSArgType` is a 1:1 mapping of [`quaint::ValueType`] that: | ||
| /// - only includes the type tag (e.g. `Int32`, `Text`, `Enum`, etc.) | ||
| /// - doesn't care for the optionality of the actual value (e.g., `quaint::Value::Int32(None)` -> `JSArgType::Int32`) | ||
| /// - is used to guide the JS side on how to serialize the query argument value before sending it to the JS driver. | ||
| #[derive(Debug, PartialEq)] | ||
| pub enum JSArgType { | ||
| /// 32-bit signed integer. | ||
| Int32, | ||
| /// 64-bit signed integer. | ||
| Int64, | ||
| /// 32-bit floating point. | ||
| Float, | ||
| /// 64-bit floating point. | ||
| Double, | ||
| /// String value. | ||
| Text, | ||
| /// Database enum value. | ||
| Enum, | ||
| /// Database enum array (PostgreSQL specific). | ||
| EnumArray, | ||
| /// Bytes value. | ||
| Bytes, | ||
| /// Boolean value. | ||
| Boolean, | ||
| /// A single character. | ||
| Char, | ||
| /// An array value (PostgreSQL). | ||
| Array, | ||
| /// A numeric value. | ||
| Numeric, | ||
| /// A JSON value. | ||
| Json, | ||
| /// A XML value. | ||
| Xml, | ||
| /// An UUID value. | ||
| Uuid, | ||
| /// A datetime value. | ||
| DateTime, | ||
| /// A date value. | ||
| Date, | ||
| /// A time value. | ||
| Time, | ||
| } | ||
|
|
||
| impl core::fmt::Display for JSArgType { | ||
| fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { | ||
| let s = match self { | ||
| JSArgType::Int32 => "Int32", | ||
| JSArgType::Int64 => "Int64", | ||
| JSArgType::Float => "Float", | ||
| JSArgType::Double => "Double", | ||
| JSArgType::Text => "Text", | ||
| JSArgType::Enum => "Enum", | ||
| JSArgType::EnumArray => "EnumArray", | ||
| JSArgType::Bytes => "Bytes", | ||
| JSArgType::Boolean => "Boolean", | ||
| JSArgType::Char => "Char", | ||
| JSArgType::Array => "Array", | ||
| JSArgType::Numeric => "Numeric", | ||
| JSArgType::Json => "Json", | ||
| JSArgType::Xml => "Xml", | ||
| JSArgType::Uuid => "Uuid", | ||
| JSArgType::DateTime => "DateTime", | ||
| JSArgType::Date => "Date", | ||
| JSArgType::Time => "Time", | ||
| }; | ||
|
|
||
| write!(f, "{}", s) | ||
| } | ||
| } | ||
|
|
||
| pub fn value_to_js_arg_type(value: &quaint::Value) -> JSArgType { | ||
| match &value.typed { | ||
| quaint::ValueType::Int32(_) => JSArgType::Int32, | ||
| quaint::ValueType::Int64(_) => JSArgType::Int64, | ||
| quaint::ValueType::Float(_) => JSArgType::Float, | ||
| quaint::ValueType::Double(_) => JSArgType::Double, | ||
| quaint::ValueType::Text(_) => JSArgType::Text, | ||
| quaint::ValueType::Enum(_, _) => JSArgType::Enum, | ||
| quaint::ValueType::EnumArray(_, _) => JSArgType::EnumArray, | ||
| quaint::ValueType::Bytes(_) => JSArgType::Bytes, | ||
| quaint::ValueType::Boolean(_) => JSArgType::Boolean, | ||
| quaint::ValueType::Char(_) => JSArgType::Char, | ||
| quaint::ValueType::Array(_) => JSArgType::Array, | ||
| quaint::ValueType::Numeric(_) => JSArgType::Numeric, | ||
| quaint::ValueType::Json(_) => JSArgType::Json, | ||
| quaint::ValueType::Xml(_) => JSArgType::Xml, | ||
| quaint::ValueType::Uuid(_) => JSArgType::Uuid, | ||
| quaint::ValueType::DateTime(_) => JSArgType::DateTime, | ||
| quaint::ValueType::Date(_) => JSArgType::Date, | ||
| quaint::ValueType::Time(_) => JSArgType::Time, | ||
| } | ||
| } |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.