-
Notifications
You must be signed in to change notification settings - Fork 234
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(typedsql): support column & param nullability #4979
Conversation
CodSpeed Performance ReportMerging #4979 will not alter performanceComparing Summary
|
WASM Query Engine file Size
|
1f8ffab
to
3e0006f
Compare
schema-engine/connectors/sql-schema-connector/src/flavour/sqlite/connection.rs
Show resolved
Hide resolved
schema-engine/connectors/sql-schema-connector/src/sql_doc_parser.rs
Outdated
Show resolved
Hide resolved
let documentation = parse_rest(input)?; | ||
|
||
let mut param = ParsedParameterDoc::default(); | ||
|
||
param.set_typ(typ); | ||
param.set_nullable(nullable.then_some(true)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need nullable to be an Option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I ended up keeping it as an Option
. The rationale is that I'd like to keep the parser unopinionated. If it finds a ?
, it's Some(true)
. Else, it's None
. It's up to the introspect_sql
implementation to give semantic value to this information, and .unwrap_or(default)
with the correct default. I did simplify things by always returning None
when ?
is not present. Previously, we returned Some(false)
when ?
was not present.
schema-engine/connectors/sql-schema-connector/src/sql_doc_parser.rs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job!
* fix(driver-adapters): fix transaction ordering for ISOLATION LEVEL, impacting PlanetScale * chore(driver-adapters): uncomment fixed PlanetScale tests * chore: retrigger CI * feat(driver-adapters): add support for TransactionContext * test(connector-test-kit-rs): uncomment succeeding "basic_serializable" test * chore(driver-adapters): fix types in executor * DRIVER_ADAPTERS_BRANCH=feat-driver-adapters-transaction-context retrigger CI/CD * feat(driver-adapters): impl Send on JsTransactionContext on wasm32 * DRIVER_ADAPTERS_BRANCH=feat-driver-adapters-transaction-context retrigger CI/CD * feat(driver-adapters): impl FromJsValue for JsTransactionContext on wasm32 * DRIVER_ADAPTERS_BRANCH=feat-driver-adapters-transaction-context retrigger CI/CD * feat(driver-adapters): impl Send for TransactionContextProxy on wasm32 * DRIVER_ADAPTERS_BRANCH=feat-driver-adapters-transaction-context retrigger CI/CD * chore: attempt Send/Sync-compatibility for JS transactions * chore: add "parse_raw_query" to "JsTransactionContext" * fix(driver-adapters): enable wasm32 compilation of "JsQueryable::start_transaction" * chore: remove commented-out method * test(connector-test-kit-rs): uncomment "interactive_tx" tests * DRIVER_ADAPTERS_BRANCH=feat/driver-adapters-transaction-context chore: retrigger CI/CD * tmp(connector-test-kit-rs): add (failing) concurrent_create_select regression test * Revert "tmp(connector-test-kit-rs): add (failing) concurrent_create_select regression test" This reverts commit cc0baab. * DRIVER_ADAPTERS_BRANCH=feat/driver-adapters-transaction-context chore: retrigger CI/CD * feat(driver-adapters): rename "parse_raw_query" to "describe_query" after #4979 * DRIVER_ADAPTERS_BRANCH=feat/driver-adapters-transaction-context chore: retrigger CI/CD * chore: don't leak concrete UnsafeFuture types * chore(driver-adapters): nit, replace "::napi" with "napi" * Revert "chore(driver-adapters): nit, replace "::napi" with "napi"" This reverts commit 808fdbe. * DRIVER_ADAPTERS_BRANCH=feat/driver-adapters-transaction-context chore: retrigger CI/CD * chore: unbox JsTransactionContext * DRIVER_ADAPTERS_BRANCH=feat/driver-adapters-transaction-context chore: retrigger CI/CD
Overview
Closes https://github.com/prisma/team-orm/issues/1258
-- @param $1:alias?
(param alias must be suffixed with?
)select id as "id?" from table
(column alias must be suffixed with?
)?column?
as column name are forbidden and require an alias to be specified. This avoids clashing with the?
suffix heuristic to override nullability.Included but not related to nullability:
-- @param {Type}
magic docs to override inferred typeSQLx
, we always treat integers asi64
's