question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

@@unique block attribute fails for non-scalar types (regression)

See original GitHub issue

Based on the following snippet from the PSL spec, @@unique should work fine for non-scalar types:

@@unique([recipe, ingredient]) would mean that the combination of fields must be unique in the table:

model RecipeIngredient {
  recipe                            Recipe
  ingredient                      Ingredient
  amount                          Float
  quantitativeDisclosures String
  comment                       String
  @@unique([recipe, ingredient])
}

The semantic meaning seems intuitive here and implies a comparison based on the @id field of the Recipe and Ingredient objects. As of 2.0.0-preview017.2, this was working but some time after that point started failing with a panic as described in #1352. #1352 was closed in favor of #1377, but @janpio mentioned #1377 covers improving the error message but not the regression.

I know nothing about Rust, but https://github.com/prisma/prisma-engine/pull/241 looks like a likely root cause to me. The timing is about right and it seems like all of the tests expect that fields passed to @@unique are scalar.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:15 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
janpiocommented, Jan 31, 2020

Week has gone, I did not get to update the issues yet. Work is still ongoing on the problem itself but we are making progress.

0reactions
janpiocommented, Feb 5, 2020

This is now cleaned up with additional issue https://github.com/prisma/prisma2/issues/1534 which is marked as a regression.

Read more comments on GitHub >

github_iconTop Results From Across the Web

rms: Regression Modeling Strategies - R Project
An attribute vinfo provides list of variables involved in each row and the type of test done. plot.anova.rms invisibly returns the vector of....
Read more >
Block attributes do not display as expected in AutoCAD
Attributes of some Block objects are not displayed as expected in AutoCAD, while they are displayed correctly inside Block Editor.
Read more >
Nastran Dmap Error Message List
DATA BLOCK NAMED %3 IS NOT REFERENCED IN SUBSEQUENT FUNCTIONAL MODULE ... Sorted Bulk Data entry type indicated must have a unique integer...
Read more >
Data Types
The codes listed for the data types are used internally by Oracle Database. The data type code of a column or object attribute...
Read more >
Diagnostic flags in Clang — Clang 16.0.0git documentation
error : taking the address of a temporary object of type A ... warning: capturing A strongly in this block is likely to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found