npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@allwhere/postgres-connector

v2.1.42

Published

This package is used to generate the `@allwhere/postgres-connector` which abstracts away the prisma client.

Readme

README

About

This package is used to generate the @allwhere/postgres-connector which abstracts away the prisma client.

This file describes a few scripts, and explains how to maintaint it.

Quick-start

The typical workflow is as follows:

  • create a sequelize migration in services/mono-service/migrations
  • run yarn ts-node .scripts/db/derive-prisma-from-sequelize-migrations.ts from the mono-repo root
    • follow further instructions based on the console log output, including:
    • Review the generated schema.prisma file and make any necessary adjustments.
    • Check for any unsupported field types like tsvector that Prisma cannot handle.
    • Ensure all models have valid unique identifiers or IDs.
    • Update fixtures as needed for the new schema.
    • Install the updated package in your dependent workspaces using the following commands:
  • continue updating your mono-service as needed.

Prisma

Introspection is used by Prisma to read the existing state of the database and define a schema (schema.prisma, which is in the same folder as this file).

** NEVER DELETE THE schema.prisma FILE!!!** the file has manual changes that will be preserved when prisma introspects. Deleting it before introspection will cause the loss of these changes

Scripts

The following usefull scripts exists in package.json

  • prisma:introspect, which does the introspection. Make sure you define a DATABASE_URL in your environmental variables before running that. you can use a .env file for that (an example file is included: env.example)
  • prisma:fix-cases, which fixes the field name casing strategies in the schema.prisma
  • prisma:pre-fix, which prepende v2 to all the models in the prisma.schema file
  • prisma:generate, which generates:
    • the PrismaClient itself, which is a whole new package being generated in the /libs subfolder
    • the dto's in the /src/dtos subfolder
  • prisma:all, which consecutively runs the 4 scripts above
  • build does 3 commands, which is required as part of the build command in the CI:
    • prisma:generate which is described above
    • yarn wrap-types which removes circular dependencies from the models graphql introspection on start-up
    • tsc the normal build script
  • patch-and-publish, which calls src/publish.sh, which updates the version of the package and publishes it to npm

How to use

After you have made a database update, you run in this folder:

  • yarn install (just in case)
  • yarn prisma:all
  • yarn build
  • yarn test to confirm all is working as expected.*
  • npm run patch-and-publish to get it published on npm. note that yarn doesn't work here

** If you use non-standard database change, that Prisma doesn't understand (like introducing a sequence or defining a ts_vector column), you may need to make the change in the migration (`migrations/0__init/migration.sql).*

** In addition, the ./test/global-setup file does one more thing that couldn't be done through a migration: set up a second user / role for the app.*

CI

The package will be published together with the @allwhere/mono-service-api package.

Environmental Variables

The following environmental variables are used. They are designed to match the mono-service normal database variables. Not all of them are currently used:

  • DB_DATABASE
  • DB_DIALECT
  • DB_HOST
  • DB_PASSWORD
  • DB_POOL_ACQUIRE_MS
  • DB_POOL_EVICT
  • DB_POOL_IDLE_MS
  • DB_POOL_MAX
  • DB_POOL_MIN
  • DB_PORT
  • DB_SCHEMA
  • DB_USERNAME

There are additional fields, required for testing. Again, these will already exist on the mono-service.

  • JEST_WORKER_ID is automatically defined by nest. We use it to spin up one database per jest worker
  • NODE_ENV this should be no surprise. During testing this will automatically be TEST
  • TEST_SET (optional) an additional field for custom database naming, typically used to descript the test commands (see mono-service package.json test:ci:* commands)
  • ALLOW_PRISMA_WRITE - DANGER! do not use in production!