db: Expose aggregation helpers (#10479)

* deps: drizzle 0.30

* feat: expose drizzle aggregation helpers

* chore: changeset
This commit is contained in:
Ben Holmes 2024-03-19 04:56:48 -04:00 committed by GitHub
parent 2330f22d6c
commit ad57a02c33
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 29 additions and 5 deletions

View file

@ -0,0 +1,5 @@
---
"@astrojs/db": minor
---
Expose Drizzle aggregation helpers including `count()` from the `astro:db` module.

View file

@ -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",

View file

@ -76,4 +76,12 @@ export {
desc,
and,
or,
count,
countDistinct,
avg,
avgDistinct,
sum,
sumDistinct,
max,
min,
} from 'drizzle-orm';

View file

@ -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
pnpm-lock.yaml generated
View file

@ -3842,8 +3842,8 @@ importers:
specifier: ^1.0.2
version: 1.0.2
drizzle-orm:
specifier: ^0.29.5
version: 0.29.5(@libsql/client@0.5.6)
specifier: ^0.30.2
version: 0.30.2(@libsql/client@0.5.6)
kleur:
specifier: ^4.1.5
version: 4.1.5
@ -10058,13 +10058,14 @@ packages:
engines: {node: '>=10'}
dev: true
/drizzle-orm@0.29.5(@libsql/client@0.5.6):
resolution: {integrity: sha512-jS3+uyzTz4P0Y2CICx8FmRQ1eplURPaIMWDn/yq6k4ShRFj9V7vlJk67lSf2kyYPzQ60GkkNGXcJcwrxZ6QCRw==}
/drizzle-orm@0.30.2(@libsql/client@0.5.6):
resolution: {integrity: sha512-DNd3djg03o+WxZX3pGD8YD+qrWT8gbrbhaZ2W0PVb6yH4rtM/VTB92cTGvumcRh7SSd2KfV0NWYDB70BHIXQTg==}
peerDependencies:
'@aws-sdk/client-rds-data': '>=3'
'@cloudflare/workers-types': '>=3'
'@libsql/client': '*'
'@neondatabase/serverless': '>=0.1'
'@op-engineering/op-sqlite': '>=2'
'@opentelemetry/api': ^1.4.1
'@planetscale/database': '>=1'
'@types/better-sqlite3': '*'
@ -10092,6 +10093,8 @@ packages:
optional: true
'@neondatabase/serverless':
optional: true
'@op-engineering/op-sqlite':
optional: true
'@opentelemetry/api':
optional: true
'@planetscale/database':