mirror of
https://github.com/withastro/astro.git
synced 2025-01-23 11:01:54 -05:00
db: Expose aggregation helpers (#10479)
* deps: drizzle 0.30 * feat: expose drizzle aggregation helpers * chore: changeset
This commit is contained in:
parent
2330f22d6c
commit
ad57a02c33
5 changed files with 29 additions and 5 deletions
5
.changeset/clever-glasses-rest.md
Normal file
5
.changeset/clever-glasses-rest.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
"@astrojs/db": minor
|
||||
---
|
||||
|
||||
Expose Drizzle aggregation helpers including `count()` from the `astro:db` module.
|
|
@ -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",
|
||||
|
|
|
@ -76,4 +76,12 @@ export {
|
|||
desc,
|
||||
and,
|
||||
or,
|
||||
count,
|
||||
countDistinct,
|
||||
avg,
|
||||
avgDistinct,
|
||||
sum,
|
||||
sumDistinct,
|
||||
max,
|
||||
min,
|
||||
} from 'drizzle-orm';
|
||||
|
|
8
packages/db/virtual.d.ts
vendored
8
packages/db/virtual.d.ts
vendored
|
@ -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
11
pnpm-lock.yaml
generated
|
@ -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':
|
||||
|
|
Loading…
Add table
Reference in a new issue