From d4c91cb10924a0627a9e9a80bc549b3c82d043e6 Mon Sep 17 00:00:00 2001 From: Nick Dubelman Date: Tue, 16 Apr 2024 14:28:20 -0700 Subject: [PATCH] db: export 'alias' from drizzle-orm/sqlite-core (#10789) * db: export 'alias' from drizzle-orm/sqlite-core * chore: changeset * fix: changeset target --------- Co-authored-by: Ben Holmes --- .changeset/few-pets-relax.md | 5 +++++ packages/db/src/runtime/virtual.ts | 2 ++ packages/db/virtual.d.ts | 1 + 3 files changed, 8 insertions(+) create mode 100644 .changeset/few-pets-relax.md diff --git a/.changeset/few-pets-relax.md b/.changeset/few-pets-relax.md new file mode 100644 index 0000000000..7e2682c274 --- /dev/null +++ b/.changeset/few-pets-relax.md @@ -0,0 +1,5 @@ +--- +"@astrojs/db": patch +--- + +Expose the Drizzle `alias` utility from `astro:db` to enable self-joins on a table. diff --git a/packages/db/src/runtime/virtual.ts b/packages/db/src/runtime/virtual.ts index ac118d6930..4159e74c1a 100644 --- a/packages/db/src/runtime/virtual.ts +++ b/packages/db/src/runtime/virtual.ts @@ -92,3 +92,5 @@ export { max, min, } from 'drizzle-orm'; + +export { alias } from 'drizzle-orm/sqlite-core'; diff --git a/packages/db/virtual.d.ts b/packages/db/virtual.d.ts index efe9e8387d..6c93137a20 100644 --- a/packages/db/virtual.d.ts +++ b/packages/db/virtual.d.ts @@ -42,4 +42,5 @@ declare module 'astro:db' { export const sumDistinct: RuntimeConfig['sumDistinct']; export const max: RuntimeConfig['max']; export const min: RuntimeConfig['min']; + export const alias: RuntimeConfig['alias']; }