Skip to content

Commit 348f230

Browse files
authored
chore(psl): unhide the typedSql preview feature (#5836)
## What Moves the `TypedSql` preview feature from the **hidden** set to the **active** set in `psl-core`'s feature classification (`psl/psl-core/src/common/preview_features.rs`). This is a **visibility-only change — no behavior changes**. `typedSql` was already a valid, fully functional preview feature when enabled explicitly in a schema; being hidden only meant it was excluded from tooling surfaces (autocomplete in language tools) and from the "Expected one of: ..." list in validation error messages. After this change it appears in both. The two tests that embed the rendered list of visible preview features (`psl/psl/tests/config/generators.rs` and `psl/psl/tests/validation/preview_features/native_full_text_search_postgres/mysql.prisma`) gain `typedSql` in their expected output. No other test or snapshot in the repository pins the classification (verified by sweeping for the rendered list and for `TypedSql` references). ## Why now Prisma ORM's agent-native documentation work recommends TypedSQL as the escape hatch for several known pitfalls (e.g. full-text search on PostgreSQL), but neither users nor AI agents can discover a hidden flag: it never shows up in autocomplete or in the valid-feature listings that errors print. Making the feature visible closes that discoverability gap. ## What stays as is - `reactNative` remains hidden. - GA/stabilization of `typedSql` is explicitly out of scope — that would make `$queryRawTyped` generation unconditional and is a separate decision with its own compatibility questions. ## Validation - `CLICOLOR_FORCE=1 cargo test -p psl --features all` — 1,297 tests green (`CLICOLOR_FORCE` matches the CI unit-test environment; the expect-test snapshots embed ANSI colors). - `cargo test -p psl-core --all-features` — green. - `cargo fmt --check -p psl-core` — clean. - CI (`make test-unit`, workspace-wide with `--all-features`) is the authoritative surface for the remaining crates; a repository-wide sweep found no other snapshot embedding the visible-features list. --------- Signed-off-by: Alexey Orlenko's AI Agent <robot@aqrln.net>
1 parent 1171e96 commit 348f230

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

psl/psl-core/src/common/preview_features.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ impl<'a> FeatureMapWithProvider<'a> {
164164
| SchemaEngineDriverAdapters
165165
| ShardKeys
166166
| StrictUndefinedChecks
167+
| TypedSql
167168
| Views
168169
}),
169170
native: HashMap::from([
@@ -231,7 +232,7 @@ impl<'a> FeatureMapWithProvider<'a> {
231232
| TransactionApi
232233
| UncheckedScalarInputs
233234
}),
234-
hidden: enumflags2::make_bitflags!(PreviewFeature::{ReactNative | TypedSql}),
235+
hidden: enumflags2::make_bitflags!(PreviewFeature::ReactNative),
235236
};
236237

237238
Self {

psl/psl/tests/config/generators.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ fn nice_error_for_unknown_generator_preview_feature() {
256256
.unwrap_err();
257257

258258
let expectation = expect![[r#"
259-
[1;91merror[0m: [1mThe preview feature "foo" is not known. Expected one of: nativeDistinct, partialIndexes, postgresqlExtensions, relationJoins, schemaEngineDriverAdapters, shardKeys, strictUndefinedChecks, views[0m
259+
[1;91merror[0m: [1mThe preview feature "foo" is not known. Expected one of: nativeDistinct, partialIndexes, postgresqlExtensions, relationJoins, schemaEngineDriverAdapters, shardKeys, strictUndefinedChecks, typedSql, views[0m
260260
--> schema.prisma:3
261261
 | 
262262
 2 |  provider = "prisma-client"

psl/psl/tests/validation/preview_features/native_full_text_search_postgres/mysql.prisma

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ model Blog {
1313
title String
1414
@@fulltext([content, title])
1515
}
16-
// [1;91merror[0m: [1mThe preview feature "fullTextSearchPostgres" is not known. Expected one of: nativeDistinct, partialIndexes, postgresqlExtensions, relationJoins, schemaEngineDriverAdapters, shardKeys, strictUndefinedChecks, views[0m
16+
// [1;91merror[0m: [1mThe preview feature "fullTextSearchPostgres" is not known. Expected one of: nativeDistinct, partialIndexes, postgresqlExtensions, relationJoins, schemaEngineDriverAdapters, shardKeys, strictUndefinedChecks, typedSql, views[0m
1717
// --> schema.prisma:3
1818
//  | 
1919
//  2 |  provider = "prisma-client"

0 commit comments

Comments
 (0)