https://www.prisma.io/ logo
Join Slack
Powered by
# prisma-go-community
  • d

    Dylan Karten

    09/30/2021, 6:51 PM
    Is there a way to print / log the full SQL query performed by the client?
    l
    • 2
    • 5
  • d

    Dylan Karten

    10/06/2021, 4:47 PM
    what would the equivalent relation query be to accomplish a
    LEFT OUTER JOIN
    ?
    l
    • 2
    • 15
  • j

    John Peña

    10/07/2021, 7:34 PM
    is there a way to turn on more verbose logs for the prisma go client? we’re facing some connection pool contention issues and would like to better understand what’s happening behind the scenes
    l
    • 2
    • 2
  • j

    John Peña

    10/12/2021, 11:45 AM
    is it possible to tune the amount of time the prisma client is waiting on a connection from the connection pool, or to get more logging around that? we’re running a service that seems to be deadlocking on prisma client reads or writes and we’d like to better understand what’s happening behind the scenes
    l
    j
    • 3
    • 70
  • a

    Ahmet

    10/19/2021, 10:09 AM
    Is prisma go client ready to be used in production?
    r
    l
    +2
    • 5
    • 24
  • a

    Ahmet

    10/19/2021, 11:42 AM
    JS Code:
    const instance = await prisma.mutation.createInstance(
      
    {
      
    data: {
       
    name: data.name.trim(),
       
    expireDate,
       
    owner: {
       
    connect: {
        
    id: userId,
       
    },
       
    },
       
    accessToken: {
       
    create: {
        
    isActive: true,
        
    token: getToken(),
       
    },
       
    },
       
    charges: {
       
    create: {
        
    expireDate,
        
    plan: 'STANDARD',
       
    },
       
    },
       
    webhook: {
       
    create: {
        
    url: '',
        
    httpOptions: {},
        
    websocketOptions: {},
    ...
    Go code:
    createdInstance, err := client.Instance.CreateOne(
      
    db.Instance.Name.Set("Test Instance - 1"),
      
    db.Instance.ExpireDate.Set(time.Now().Add(24*time.Hour*365)),
      
    db.Instance.User.Link(
       
    db.User.ID.Equals(user_id),
      
    ),
      
    // Nested Create? (accessToken, charges, webhook)
    ).Exec(ctx)
    if err != nil {
      
    return err
    }
  • a

    Ahmet

    10/19/2021, 11:43 AM
    How can I nested create in golang?
    l
    • 2
    • 4
  • l

    Luca

    10/20/2021, 9:17 AM
    <!channel> We just released v0.12.0! gopher happy Apart from the usual bugfixes and minor improvements, this release introduces scalar list operations. Given the following Prisma schema:
    Copy code
    model User {
      id   Int      @id @default(autoincrement())
      name String
      pets String[]
    }
    You can filter pets with the following code:
    Copy code
    user, err := client.User.FindFirst(
      db.User.Pets.HasSome([]string{"Fido", "Scooby"}),
    ).Exec(ctx)
    And when you add a new furry addition to your family, you can update your list with `Push`:
    Copy code
    user, err := client.User.FindUnique(
      db.User.Name.Equals(1),
    ).Update(
      db.User.Items.Push([]string{"Charlemagne"}),
    ).Exec(ctx)
    Learn more about how to use this new feature in our documentation and share your feedback here!
    prisma rainbow 5
    👍 5
  • g

    Gavin Watson

    11/09/2021, 7:28 PM
    Hello, does Prisma happen to have support for creating a non-unique index on a JSON field in the schema file? Or is custom migrations the way to do this kind of thing right now?
    l
    a
    • 3
    • 3
  • t

    Travis James

    11/16/2021, 12:54 PM
    How would you guys compare the Prisma Go Client to Ent.go from Facebook?
    l
    • 2
    • 5
  • b

    Barnaby

    12/06/2021, 10:17 AM
    Deployed a test app to our userbase (few thousand people) and getting a lot of outages caused by
    Timed out fetching a connection from the pool
    is there something I'm missing from queries to get Prisma to release connections back to the pool?
    t
    • 2
    • 2
  • h

    Hervé - Product at Prisma

    01/17/2022, 11:17 AM
    set the channel topic: [Unmaintained]gopher happy The Prisma Go client. https://github.com/prisma/prisma-client-go
    😭 2
  • j

    John Peña

    01/20/2022, 1:56 PM
    was there any community survey or user outreach that happened as part of the decision to deprecate the go client?
    n
    m
    +2
    • 5
    • 16
  • b

    Barnaby

    02/08/2022, 12:41 PM
    I know the Go project is dead but is there any way we can just fire GraphQL queries at the Prisma engine?
    l
    • 2
    • 3
  • b

    Barnaby

    02/08/2022, 12:41 PM
    feels super simple, low effort maintenance, no code-generation required
  • b

    BryanM

    02/08/2022, 5:53 PM
    I'm thinking of migrating to Ent. Has anyone else started the migration process?
    t
    b
    • 3
    • 3
  • r

    Robert Craigie

    02/10/2022, 3:30 AM
    Hey @Luca, would it be possible to bump the CLI binary version please 🙂
    ✅ 1
    l
    • 2
    • 2
  • t

    Travis James

    02/21/2022, 2:42 PM
    I must say that I am sad to see that this project is being abandoned, as I believe it would be extremely useful --especially if the following changes were made: 1. Enable
    prisma-engines
    to be loaded as a library (similar to what is done with the Node.js side) with a CGo interface, so there is no need for a second process. 2. Extend the Prisma Go SDK interface to include structure similar to Ent--creating hooks for business logic before and after CRUD actions, etc. 3. Provide a way to hook in authentication and authorization. 4. Integrate with GQLGen in a manner that allows for creating GraphQL interfaces that can be slightly different but mapped neatly to Prisma GraphQL interfaces. If I were to get a group together to build such a thing (with people here and others), would Prisma support letting this project live, @Luca?
    l
    • 2
    • 2
  • b

    Barnaby

    02/22/2022, 8:04 PM
    I think things like hooks for business logic and auth are feature-creep and go against modern application architectures that keep datasource layers separate from business logic
    t
    • 2
    • 1
  • b

    Barnaby

    02/22/2022, 8:04 PM
    Honestly, I think the current Go Prisma API was a really nice design - it had some issues but if there was a group willing to maintain it, it could live on and continue providing value
    🙏 1
    👍 2
  • b

    Barnaby

    02/22/2022, 8:05 PM
    I have a couple of fairly substantial open source projects that still have Prisma Go code in them that could act as examples and test bases for continuing development from the community's side
  • b

    Barnaby

    03/12/2022, 11:34 AM
    Would Go users benefit from a Prisma-to-Ent converter?
  • b

    Barnaby

    03/12/2022, 11:37 AM
    shouldn’t be too hard:
    Copy code
    import { DMMF } from "@prisma/generator-helper";
    import { getDMMF } from "@prisma/sdk";
    
    const modelToGo = (model: DMMF.Model) => {
      const { name, fields } = model;
    
      // TODO: generate a list of fields
      // TODO: generate a list of relationships
    
      const fieldsString = "";
      const edgesString = "";
    
      const source = `
      package schema
    
      import "<http://entgo.io/ent|entgo.io/ent>"
      
      // ${name} holds the schema definition for the ${name} entity.
      type ${name} struct {
          ent.Schema
      }
      
      // Fields of the ${name}.
      func (${name}) Fields() []ent.Field {
          return ${fieldsString}
      }
      
      // Edges of the ${name}.
      func (${name}) Edges() []ent.Edge {
          return ${edgesString}
      }
    `;
    
      return {
        source,
        name,
      };
    };
    
    (async () => {
      const dmmf = await getDMMF({ datamodelPath: "prisma/schema.prisma" });
    
      const models = dmmf.datamodel.models.map(modelToGo);
    
      console.log(models);
    
      // TODO: Dump models to ./ent/schema/{name}
      // TODO: Invoke `go generate`
    })();
  • b

    Barnaby

    03/12/2022, 11:38 AM
    Might see what I can do to finish this off, I have a couple of large projects still using Prisma Go, and even though they are working find and I love prisma, I just can’t have the potential bugs and security risks of an unmaintained database layer
  • b

    Barnaby

    03/12/2022, 11:38 AM
    @ me if you are interested in such a tool!
  • b

    Barnaby

    03/12/2022, 12:28 PM
    WIP repo if anyone wants to contribute: https://github.com/Southclaws/prisment
    t
    l
    • 3
    • 5
  • v

    Vladi Stevanovic

    03/22/2022, 7:35 AM
    👋 Hello! As a quick reminder, the #prisma-client-go is a community channel as we've stopped the development on the Go Client (more information here: #707) You're free to ask questions, ask for help or share your feedback on this channel, and work with the other Go users. ℹ️ However, the Prisma Team is here to only moderate and not to provide support. Prisma complete ORM issues (for other clients) should be posted in #general Prisma Data Platform issues should be sent via ticket
  • b

    Barnaby

    04/04/2022, 7:18 PM
    For the abandoned Prisma+Go users: One alternative I’ve been using recently as I’ve found SQLBoiler to be problematic is Ent which I wrote a converter for here which is great! But one downside is you lose the declarative nature of Prisma’s schema when switching to Ent - which I think is one of the most amazing features of Prisma. I also found Atlas which has a HCL based declarative schema and migration tooling which mirrors that of Prisma. It also has a really nice user interface for exploring and visualising the data model. I’ve noticed that Ent and Atlas are getting closer as Ent now supports using Atlas as the migration engine. Because of this, I’d love to see Ent using the data model language in Atlas, this would complete the circle and make it a full replacement for Prisma in the Go world. I’ve opened an issue in Ent here to propose using Atlas as a schema source. Anyway, hope that helps some people out here who are still looking for alternatives!
    👍 2
    l
    d
    • 3
    • 6
  • d

    Deepak Guptha S

    08/10/2022, 9:51 AM
    👋 Hello, I don't know how to perform bulk insertion, updation or deletion in Prisma for
    GoLang
    Or how to perform transaction for multiple records (insertion, updation or deletion) using
    executeRaw
    Is there any examples or documentation link ?
    👀 1
    ✅ 1
    n
    • 2
    • 1
  • v

    Vladi Stevanovic

    09/26/2022, 8:28 AM
    👋 Hello everyone! To streamline support for our Community, all questions about the Prisma ORM (Client, Studio, Migrate) will now be answered in #orm-help channel, and this channel will be archived is now archived. We hope this will allow us to help you more quickly and share the knowledge among all our community members. 😊 If you have any pending questions/issues, feel free to resolve them in the current threads or move the conversation into #orm-help! gopher ok Happy coding!