Coder Social home page Coder Social logo

Comments (4)

divyenduz avatar divyenduz commented on August 24, 2024

@tristancaron : Can you share a minimal reproduction for this? Like how does your datamodel look like?

from prisma-client-js.

pantharshit00 avatar pantharshit00 commented on August 24, 2024

I can't reproduce this with the following datamodel and code:

datasource db {
  provider = "mysql"
  url      = "mysql://root:Harshit00@localhost:3306/issue_60"
}

generator photon {
  provider = "photonjs"
}

enum Priviliages {
  ADMIN
  USER
}

model User {
  id          String      @id @default(cuid())
  username    String      @unique
  password    String
  age         Int         @default(18)
  priviliages Priviliages
}
// @ts-check
const Photon = require('@generated/photon')

const photon = new Photon.default()

async function main() {
  await photon.connect()

  const res = await photon.users.findMany({
    select: {
      priviliages: true,
    },
  })
  console.log(JSON.stringify(res))
}

main()
  .then(async () => {
    await photon.disconnect()
  })
  .catch(async () => {
    await photon.disconnect()
  })

image

from prisma-client-js.

tristancaron avatar tristancaron commented on August 24, 2024

Here a project that is not working for me.

I added the file schema.sql that we do use for the moment.

Once it's all set up, I run:
prisma2 introspect --mysql-db orion --mysql-host 127.0.0.1 --mysql-port 3306 --mysql-user root --mysql-password admin

I move the file generated into prisma/project.prisma and add the lines:

generator photon {
  provider = "photonjs"
}

Then I run
prisma2 generate

And finally
node index.js

We don't use Lift for the moment, it is not "stable" enough for our Alpha product. But I guess it's another topic. (In case you wonder, we have naming issues for the relations tables, and migration doesn't work well, so the first time we run prisma2 dev it's okay, but the second time, even we don't do any changes, it fails)

I hope it will help!

issue_63.zip

from prisma-client-js.

pantharshit00 avatar pantharshit00 commented on August 24, 2024

Ok, got it. We just merged a fix for this.

6f7d983

from prisma-client-js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.