prisma-dl

0.1.1 • Public • Published

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)

Readme

Keywords

Package Sidebar

Install

npm i prisma-dl

Weekly Downloads

0

Version

0.1.1

License

MIT

Unpacked Size

25.7 kB

Total Files

5

Last publish

Collaborators

  • hheex