Query
and Database
). This allows devs to type Query.<Tab>
and get a full list of everything they can do or Database.<Tab>
to get a list of all tables. This prevents the need to hunt through Drizzle docs to find the function you need.
There’s a lot of room for improvement here, and we’ll likely write a thin layer on top of Drizzle to help streamline insert & update statements.
WASM vs pure TypeScript
Prisma depends ona WASM module in order to serialize & deserialize database queries. This is intended to make the client faster, but it makes Prisma (a) harder to run in serverless with larger bundles and (b) requires finnessing to reuse the same WASM engine across multiple generated libraries.
Drizzle’s TypeScript-native interface is much more lightweight.
Dependency on Node (and therefore Docker)
Prisma has a lot of bugs when running under Drizzle.
To work around this, we used to ship a copy of both Deno & Node in order to run Prisma commands.
Heavy vs lightweight
Prisma takes a long time to run commands & generate SDKs. This made running opengb dev
take a long time. It also frequently failed for unknown reasons, likely because it had so many network dependencies it had to download and race conditions when running Prisma in parallel.
Unnecessary SELECT
statement after create
& other unoptimized commands
See this issue.
This has a pretty nasty performance impact when inserting rows frequently. Most use cases won’t notice the impact, but it’s important to be aware of for performance-sensitive modules.
No headless migrations CLI
Prisma requires a TTY to run development migrations. It took a lot of work to get the Prisma CLI to play nice with the Open Game Backend dev
command. It would be nice to have a raw API we can call to run migrations within our own code.
Slow builds
Prisma takes a long time to build new clients. Open Game Backend caches heavily and parallelizes builds to make this less of an issue, but it’s still a pain point.