Skip to content

Commit

Permalink
Make all named exports work for ESM (#2247)
Browse files Browse the repository at this point in the history
  • Loading branch information
lehni authored Mar 18, 2022
1 parent 6ab6dd8 commit 4e04f55
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions lib/objection.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
'use strict';

const { wrapError, ...DbErrorClasses } = require('db-errors');
const {
DBError,
UniqueViolationError,
NotNullViolationError,
ForeignKeyViolationError,
ConstraintViolationError,
CheckViolationError,
DataError,
} = require('db-errors');
const { Model: NativeModel } = require('./model/Model');
const { QueryBuilder: NativeQueryBuilder } = require('./queryBuilder/QueryBuilder');
const { QueryBuilderBase } = require('./queryBuilder/QueryBuilderBase');
Expand Down Expand Up @@ -88,5 +96,11 @@ module.exports = {
knexSnakeCaseMappers,
knexIdentifierMapping,

...DbErrorClasses,
DBError,
UniqueViolationError,
NotNullViolationError,
ForeignKeyViolationError,
ConstraintViolationError,
CheckViolationError,
DataError,
};

0 comments on commit 4e04f55

Please sign in to comment.