Skip to content

unlight/prisma-tech-talk

Repository files navigation

prisma-tech-talk

Contents

  • Comparison of tools
  • What is Prisma Framework
  • How it works
  • Schema.Prisma
  • Example of user.findOne (type safe)
  • Example of write operations (with connect)
  • Aggregation example
  • Integration with TypeGraphQL / NestJS
  • Competitors

Prisma

Resources

FAQ

What about dynamic provider?

Currently, when generating a Prisma Client, it is specific to a provider (sqlite, postgres or mysql). You cannot reuse the same client and specify a provider which it wasn't generated for. But there is a feature request to do that. prisma/prisma#1487 (comment)

MongoDB support for Prisma 2?

In progress prisma/prisma#1277

Performance

Not a goal for the beta, optimization will be later https://github.com/prisma/prisma/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+performance

Transactions

prisma/prisma-client-js#667 prisma/prisma#1844 Use write operations with connect
Since 2.1.0 available as experimrntal feature (explicit transactions)

Multiple schema files

prisma/prisma#2377

Atomic operations

prisma/prisma-client-js#655 https://www.prisma.io/docs/concepts/components/prisma-client/crud#atomic-operations-on-update

ORM can resolve n + 1 problem too

https://mikro-orm.io/docs/nested-populate Yes, but no type safety in this example.

https://github.com/typeorm/typeorm/blob/master/docs/eager-and-lazy-relations.md In this example I must define it as column definition, what if need both lazy and eager...

Why ORM is Partial Typesafety

https://sequelize.org/master/manual/typescript.html#usage (bottom of section Usage, before "Usage without strict types for attributes" section, spot "console.log(ourUser.projects![0].name")

Why middleware as query engine is needed

Possible, to make prisma framework language indepedent, having such query engine allow to create prisma cient for another language.