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 🙏

© 2024 – Pkg Stats / Ryan Hefner

drizzle-postgis

v1.1.1

Published

A Drizzle extension/plugin to help work with PostGIS and GeoJSON

Downloads

143

Readme

🚸 Disclaimer

I'm a GIS beginner, please let me know if you see anything problematic in the way this library is implemented. The library is also missing support for very many functions. PRs are very welcome, all I ask is that you add test coverage for any new functions :)

🎉 Installation

pnpm add drizzle-postgis

Patching drizzle-kit (See Troubleshooting for more info) is no longer required in most cases (unless you need to generate migrations with a box2d type).

❓Troubleshooting

If you're having trouble with Postgres complaining that the functions can't be found, try using config.setPostGISSchema("<schema>")

There's more information about how to use these functions here: https://postgis.net/docs/reference.html

NOTE for people using box2d

Unfortunately drizzle-kit has a bug that causes some custom types to be quoted. The only type in this library that is still affected (as of drizzle-kit 0.22.0) is box2d. In order to use this with migrations, you need to apply a patch (see below). This issue tracks this problem somewhat: https://github.com/drizzle-team/drizzle-kit-mirror/issues/350

Step 1: Obtain the Patch File

The patch file is located in repository under the patches directory: patches/drizzle-kit@<version>.patch. (Replace with your installed version of drizzle-kit).

You can copy the patch file content directly from the repository to your local patches directory.

Step 2: Apply the Patch

If you're using pnpm, you can apply the patch by adding the following lines to your package.json file under the pnpm section:

  "pnpm": {
    "patchedDependencies": {
      "drizzle-kit@<version>": "patches/drizzle-kit@<version>.patch"
    }
  }

This configuration tells pnpm to apply the specified patch to the drizzle-kit@<version> dependency. Note that patches/drizzle-kit@<version>.patch is the path to the patch file

After updating your package.json, run pnpm install to install the patched dependency.

Alternative: Manual Patching (not recommended)

If you prefer not to modify your package.json, you can manually apply the patch using the patch command:

  1. Save the patch file content to a local file, e.g., drizzle-kit.patch.
  2. Navigate to the directory where drizzle-kit is installed (usually node_modules/drizzle-kit).
  3. Run the following command: patch -p1 < /path/to/drizzle-kit.patch

This will apply the patch to the drizzle-kit dependency.

📚 Auto generate docs

The project is configured to auto-generate the documentation using typedoc. The documentation is generated in the docs folder.

The documentation will get generated when the code is pushed to the main branch. You can also generate the documentation locally by running the command pnpm run build:docs.

🫱🏻‍🫲🏼 Contributing

Please make sure to follow the conventional commit messages format while making changes. This helps in generating changelogs and versioning the package.

🙏 Thanks to