Skip to content

Preview feature feedback: Node-API support (nApi) #6301

Closed

Description

@matthewmueller

Please share your feedback about the nApi functionality released in v2.20.0 in this issue.

  • If you encounter a bug, please open a bug report in this repo.
  • If the feature is working well for you, please share this in a comment below or leave a 👍 on this issue.

If you have any questions, don't hesitate to ask them in the #prisma-client channel in the Prisma Slack.

Known Limitations

  • (Resolved) You can't have more than one instance of the Prisma Client yet, so this will not work properly:
    const prisma1 = new PrismaClient()
    const prisma2 = new PrismaClient()
  • (Resolved) Currently, logging queries does not work with Node-API and Jest (Issue). For example, the following will not output any query logs. (Note: This seems to only be the case when using jest)
     const prisma = new PrismaClient({
       log: ['query']
     })
  • (Resolved) Node-API libraries do not work with process mocking of Jest (issue)
  • Node-API does not work on M1 ARM Macs, Apple Silicon (issue)
  • Node-API does not work on 32bit Node (issue)

Activity

  1. added
    topic: previewFeatures
    topic: node-api
    on Mar 29, 2021
  2. changed the title [-]Preview feature feedback: Order by Relations support (`napi`)[/-] [+]Preview feature feedback: N-API support (`napi`)[/+] on Mar 29, 2021
  3. pimeys commented on Mar 29, 2021

    @pimeys
  4. Akxe commented on Mar 30, 2021

    @Akxe
  5. pimeys commented on Mar 30, 2021

    @pimeys
  6. janpio commented on Mar 30, 2021

    @janpio
  7. Akxe commented on Mar 30, 2021

    @Akxe
  8. pantharshit00 commented on Apr 22, 2021

    @pantharshit00
  9. P4sca1 commented on Apr 30, 2021

    @P4sca1
  10. pimeys commented on Apr 30, 2021

    @pimeys
  11. carlitorweb commented on May 4, 2021

    @carlitorweb
  12. pimeys commented on May 4, 2021

    @pimeys
  13. 31 remaining items

  14. vjpr commented on May 31, 2021

    @vjpr
  15. janpio commented on May 31, 2021

    @janpio
  16. vjpr commented on May 31, 2021

    @vjpr
  17. janpio commented on May 31, 2021

    @janpio
  18. pimeys commented on Jun 3, 2021

    @pimeys

    Throughput solved in latest dev.

  19. changed the title [-]Preview feature feedback: Node API support (`napi`)[/-] [+]Preview feature feedback: Node API support (`nApi`)[/+] on Jun 5, 2021
  20. changed the title [-]Preview feature feedback: Node API support (`nApi`)[/-] [+]Preview feature feedback: Node-API support (`nApi`)[/+] on Jun 5, 2021
  21. k-sae commented on Jun 24, 2021

    @k-sae

    Originally posted here: #5792.

    I had a major performance drawback when I was migrating from sequelize and seems the nApi solved it for me.
    Here are the details:

    Environment

    os: Linux (5.10.42-1-MANJARO)
    DB: MySQL (10.4.19-MariaDB)
    Node: v16.3.0
    prisma: 2.25
    

    Prisma schema:

    model employees {
      emp_no       Int              @id
      birth_date   DateTime         @db.Date
      first_name   String           @db.VarChar(14)
      last_name    String           @db.VarChar(16)
      gender       employees_gender
      hire_date    DateTime         @db.Date
    }

    DB: employees_db

    Code:

    for (let index = 0; index < 2000; index++) {
        const employees = await prisma.employees.findMany({
          take: 100
        })
    }

    Results:

    prisma: 42.497s
    nApiPrisma: 6.146s
    

    Full code here: https://github.com/k-sae/employees_prisma

  22. SynergyEvolved commented on Jul 3, 2021

    @SynergyEvolved
  23. pimeys commented on Jul 4, 2021

    @pimeys
  24. janpio commented on Jul 4, 2021

    @janpio
  25. SynergyEvolved commented on Jul 4, 2021

    @SynergyEvolved
  26. added this to the 2.31.0 / 3.0.x milestone on Aug 19, 2021
  27. 2color commented on Sep 7, 2021

    @2color
    Contributor

    Closing this now that this has been released to General Availability in the 3.0.1 release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: node-apitopic: previewFeatures

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions