prisma / studio

🎙️ The easiest way to explore and manipulate your data in all of your Prisma projects.
https://www.prisma.io/studio
1.89k stars 47 forks source link

Editing JSON fields does not allow using scalar values (string, number, ..) #813

Open Zajozor opened 2 years ago

Zajozor commented 2 years ago
  1. Prisma version (prisma -v or npx prisma -v):

    Environment variables loaded from .env
    prisma                  : 3.1.1
    @prisma/client          : 3.1.1
    Current platform        : darwin-arm64
    Query Engine (Node-API) : libquery-engine c22652b7e418506fab23052d569b85d3aec4883f (at node_modules/@prisma/engines/libquery_engine-darwin-arm64.dylib.node)
    Migration Engine        : migration-engine-cli c22652b7e418506fab23052d569b85d3aec4883f (at node_modules/@prisma/engines/migration-engine-darwin-arm64)
    Introspection Engine    : introspection-core c22652b7e418506fab23052d569b85d3aec4883f (at node_modules/@prisma/engines/introspection-engine-darwin-arm64)
    Format Binary           : prisma-fmt c22652b7e418506fab23052d569b85d3aec4883f (at node_modules/@prisma/engines/prisma-fmt-darwin-arm64)
    Default Engines Hash    : c22652b7e418506fab23052d569b85d3aec4883f
    Studio                  : 0.423.0
    Preview Features        : interactiveTransactions
  2. Logs from Developer Tools Console or Command line, if any:

  3. Does the issue persist even after updating to the latest prisma alpha? (npm i -D @prisma/cli@dev) yes

  4. Prisma schema (if relevant):

    • any json field

issue description

When editing json fields in the prisma studio, scalar values (number, string, ...) don't pass field validation. I can still enter array and object values, but scalar values are also valid json and should be supported too.

Picture - scalar values show in red, and you cannot press save. But they can be obviously put in through actual prisma calls. CleanShot 2021-12-17 at 17 27 32

If there is some super simple fix, please guide me and I can also try looking into contributing a fix :)

Thanks for an amazing tool!

Zajozor commented 2 years ago

is there any chance for a progress on this :) ?

Here are some of the related issues:

camin-mccluskey commented 1 year ago

+1 to this, strings and numbers are valid JSON which should be reflected in Prisma studio. Right now we need to find an alternative to adjust data of this type locally, or write scripts for 1 off changes which could be done using a GUI