Skip to content

Instantly share code, notes, and snippets.

@aleclarson
Created June 24, 2025 22:54
Show Gist options
  • Save aleclarson/5f3ea45dfff51e15fe3816141a525ec8 to your computer and use it in GitHub Desktop.
Save aleclarson/5f3ea45dfff51e15fe3816141a525ec8 to your computer and use it in GitHub Desktop.
diff --git a/alias.js b/alias.js
index a2e9dddc6b19e5668d23b2b25a0718ee2a201c37..6d21587b4e771ffb406d6193d381076bc5c5f229 100644
--- a/alias.js
+++ b/alias.js
@@ -98,7 +98,7 @@ function mapColumnsInSQLToAlias(query, alias) {
return mapColumnsInAliasedSQLToAlias(c, alias);
}
return c;
- }));
+ })).mapWith(query.decoder);
}
export {
ColumnAliasProxyHandler,
@aleclarson
Copy link
Author

⚡ Apply Remote Git Patch with patch-package in One Command

Prerequisites

  • You have patch-package installed:

  • npm install patch-package --save-dev

  • You have curl or wget available in your system.

  • The target package (e.g., drizzle-orm) is already installed in your node_modules.


One-liner Command to Apply the Patch

curl -sSL https://gist.githubusercontent.com/aleclarson/5f3ea45dfff51e15fe3816141a525ec8/raw/84bbe33fc0161a5b66fa69e8879fb7406d4514e0/drizzle-pr-1694.patch -o patches/drizzle-orm+0.30.0.patch

Explanation

  • Replace drizzle-orm+0.30.0.patch with the correct patch filename for your installed package version. The format is:

<package-name>+<version>.patch

You can find the exact version by running:

  • npm ls drizzle-orm

  • The patches folder is where patch-package expects patches to live by default.


Full Example in One Terminal Line

If your project uses [email protected], run:

mkdir -p patches && curl -sSL https://gist.githubusercontent.com/aleclarson/5f3ea45dfff51e15fe3816141a525ec8/raw/84bbe33fc0161a5b66fa69e8879fb7406d4514e0/drizzle-pr-1694.patch -o patches/drizzle-orm+0.30.0.patch

Then ensure your postinstall script in package.json includes:

"scripts": { "postinstall": "patch-package" }

So the patch applies automatically after installs.


Alternative with PNPM Patcher (pnpm patch)

If you prefer PNPM's patching system:

pnpm patch drizzle-orm

This will open the package in an editable folder. Apply the patch like so:

curl -sSL https://gist.githubusercontent.com/aleclarson/5f3ea45dfff51e15fe3816141a525ec8/raw/84bbe33fc0161a5b66fa69e8879fb7406d4514e0/drizzle-pr-1694.patch | patch -p1

Then finalize:

pnpm patch-commit drizzle-orm


Summary One-Liner for patch-package

mkdir -p patches && curl -sSL <PATCH_URL> -o patches/<package-name>+<version>.patch

Replace <PATCH_URL>, <package-name>, and <version> accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment