File tree Expand file tree Collapse file tree 9 files changed +21
-24
lines changed Expand file tree Collapse file tree 9 files changed +21
-24
lines changed Original file line number Diff line number Diff line change 1+ - Fix wrong DrizzleQueryError export. thanks @nathankleyn
Original file line number Diff line number Diff line change 11{
22 "name" : " drizzle-orm" ,
3- "version" : " 0.44.3 " ,
3+ "version" : " 0.44.4 " ,
44 "description" : " Drizzle ORM package for SQL databases" ,
55 "type" : " module" ,
66 "scripts" : {
Original file line number Diff line number Diff line change @@ -10,6 +10,20 @@ export class DrizzleError extends Error {
1010 }
1111}
1212
13+ export class DrizzleQueryError extends Error {
14+ constructor (
15+ public query : string ,
16+ public params : any [ ] ,
17+ public override cause ?: Error ,
18+ ) {
19+ super ( `Failed query: ${ query } \nparams: ${ params } ` ) ;
20+ Error . captureStackTrace ( this , DrizzleQueryError ) ;
21+
22+ // ES2022+: preserves original error on `.cause`
23+ if ( cause ) ( this as any ) . cause = cause ;
24+ }
25+ }
26+
1327export class TransactionRollbackError extends DrizzleError {
1428 static override readonly [ entityKind ] : string = 'TransactionRollbackError' ;
1529
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11import { type Cache , hashQuery , NoopCache } from '~/cache/core/cache.ts' ;
22import type { WithCacheConfig } from '~/cache/core/types.ts' ;
33import { entityKind , is } from '~/entity.ts' ;
4- import { TransactionRollbackError } from '~/errors.ts' ;
5- import { DrizzleQueryError } from '~/errors/index.ts' ;
4+ import { DrizzleQueryError , TransactionRollbackError } from '~/errors.ts' ;
65import type { TablesRelationalConfig } from '~/relations.ts' ;
76import type { PreparedQuery } from '~/session.ts' ;
87import type { Query , SQL } from '~/sql/index.ts' ;
Original file line number Diff line number Diff line change 11import { type Cache , hashQuery , NoopCache } from '~/cache/core/cache.ts' ;
22import type { WithCacheConfig } from '~/cache/core/types.ts' ;
33import { entityKind , is } from '~/entity.ts' ;
4- import { TransactionRollbackError } from '~/errors.ts' ;
5- import { DrizzleQueryError } from '~/errors/index.ts' ;
4+ import { DrizzleQueryError , TransactionRollbackError } from '~/errors.ts' ;
65import type { RelationalSchemaConfig , TablesRelationalConfig } from '~/relations.ts' ;
76import { type Query , type SQL , sql } from '~/sql/sql.ts' ;
87import type { Assume , Equal } from '~/utils.ts' ;
Original file line number Diff line number Diff line change 11import { type Cache , hashQuery , NoopCache } from '~/cache/core/cache.ts' ;
22import type { WithCacheConfig } from '~/cache/core/types.ts' ;
33import { entityKind , is } from '~/entity.ts' ;
4- import { TransactionRollbackError } from '~/errors.ts' ;
5- import { DrizzleQueryError } from '~/errors/index.ts' ;
4+ import { DrizzleQueryError , TransactionRollbackError } from '~/errors.ts' ;
65import type { TablesRelationalConfig } from '~/relations.ts' ;
76import type { PreparedQuery } from '~/session.ts' ;
87import { type Query , type SQL , sql } from '~/sql/index.ts' ;
Original file line number Diff line number Diff line change 11import { type Cache , hashQuery , NoopCache } from '~/cache/core/cache.ts' ;
22import type { WithCacheConfig } from '~/cache/core/types.ts' ;
33import { entityKind , is } from '~/entity.ts' ;
4- import { TransactionRollbackError } from '~/errors.ts' ;
5- import { DrizzleQueryError } from '~/errors/index.ts' ;
4+ import { DrizzleQueryError , TransactionRollbackError } from '~/errors.ts' ;
65import type { RelationalSchemaConfig , TablesRelationalConfig } from '~/relations.ts' ;
76import { type Query , type SQL , sql } from '~/sql/sql.ts' ;
87import type { Assume , Equal } from '~/utils.ts' ;
Original file line number Diff line number Diff line change 11import { type Cache , hashQuery , NoopCache } from '~/cache/core/cache.ts' ;
22import type { WithCacheConfig } from '~/cache/core/types.ts' ;
33import { entityKind , is } from '~/entity.ts' ;
4- import { DrizzleError , TransactionRollbackError } from '~/errors.ts' ;
5- import { DrizzleQueryError } from '~/errors/index.ts' ;
4+ import { DrizzleError , DrizzleQueryError , TransactionRollbackError } from '~/errors.ts' ;
65import { QueryPromise } from '~/query-promise.ts' ;
76import type { TablesRelationalConfig } from '~/relations.ts' ;
87import type { PreparedQuery } from '~/session.ts' ;
You can’t perform that action at this time.
0 commit comments