Skip to content
This repository has been archived by the owner on Mar 7, 2023. It is now read-only.
/ prisma-dl Public archive

take control of prisma binaries

License

Notifications You must be signed in to change notification settings

youjinbu/prisma-dl

Repository files navigation

npm version CI GitHub license

Prisma Binary Downloader [WIP]

NO more automatic downloads of huge binaries. (examples)

Usage

Make sure wget and gzip are installed.

Overrides/Resolutions

for cheating the postinstall in prisma, we need to override @prisma/engines package to prisma-dl via package manager like pnpm or yarn.

pnpm
{
  "pnpm": {
    "overrides": {
      "@prisma/engines": "npm:prisma-dl@latest"
    }
  }
}
yarn
{
  "resolutions": {
    "@prisma/engines": "https//registry.npmjs.org/prisma-dl/-/prisma-dl-__LATEST_VERSION__.tgz"
  }
}

Installation

  • [package manager] add -D prisma-dl prisma
  • [package manager] add @prisma/client

Download binaries

With this package installed, we will need to download the appropriate binary manually:

$ pnpm prisma-dl --engine query
$ pnpm prisma-dl --engine fmt
prisma-dl --help
Usage

  $ prisma-dl  [options]

Options

   -h, --help  Display this help message
     --engine  Engine type
               <query|fmt|migration|introspection>
               Defaults to query
   --platform  Engine Platform
               <native|darwin|linux-musl|windows|...>
               Defaults to native
    --project  Project Root
               Defaults to current directory
      --print  Print fetch options without downloading binary
        --out  Output dir
               Defaults to [project root]/binaries

Requirements

  • pnpm or yarn
  • Node >= 14.16.0 :P

TODO

  • libquery-engine
  • Find a way to skip the node_modules/prisma/engiens/[hash]/query-engine-darwin copy
  • Tests

License

MIT (not sure, correct me)