Skip to content

Commit

Permalink
db: Expose aggregation helpers (#10479)
Browse files Browse the repository at this point in the history
* deps: drizzle 0.30

* feat: expose drizzle aggregation helpers

* chore: changeset
  • Loading branch information
bholmesdev authored Mar 19, 2024
1 parent 2330f22 commit ad57a02
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/clever-glasses-rest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@astrojs/db": minor
---

Expose Drizzle aggregation helpers including `count()` from the `astro:db` module.
2 changes: 1 addition & 1 deletion packages/db/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"@libsql/client": "^0.5.5",
"async-listen": "^3.0.1",
"deep-diff": "^1.0.2",
"drizzle-orm": "^0.29.5",
"drizzle-orm": "^0.30.2",
"kleur": "^4.1.5",
"nanoid": "^5.0.1",
"open": "^10.0.3",
Expand Down
8 changes: 8 additions & 0 deletions packages/db/src/runtime/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,12 @@ export {
desc,
and,
or,
count,
countDistinct,
avg,
avgDistinct,
sum,
sumDistinct,
max,
min,
} from 'drizzle-orm';
8 changes: 8 additions & 0 deletions packages/db/virtual.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,12 @@ declare module 'astro:db' {
export const desc: RuntimeConfig['desc'];
export const and: RuntimeConfig['and'];
export const or: RuntimeConfig['or'];
export const count: RuntimeConfig['count'];
export const countDistinct: RuntimeConfig['countDistinct'];
export const avg: RuntimeConfig['avg'];
export const avgDistinct: RuntimeConfig['avgDistinct'];
export const sum: RuntimeConfig['sum'];
export const sumDistinct: RuntimeConfig['sumDistinct'];
export const max: RuntimeConfig['max'];
export const min: RuntimeConfig['min'];
}
11 changes: 7 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ad57a02

Please sign in to comment.