@nextlyhq/adapter-drizzle 0.0.2-alpha.6 → 0.0.2-alpha.60

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -64,6 +64,23 @@ interface DatabaseError extends Error {
64
64
  * @public
65
65
  */
66
66
  declare function isDatabaseError(error: unknown): error is DatabaseError;
67
+ /**
68
+ * Whether an error is the application's verdict rather than the database's
69
+ * failure.
70
+ *
71
+ * Work running inside a transaction may throw to roll the write back — a
72
+ * refused value, a permission denial — and such an error is not something the
73
+ * driver produced. Classifying it as a database error replaces its code and its
74
+ * payload with a generic one, so a caller that asked for a refusal is handed an
75
+ * unexplained failure instead, and per-field validation detail is lost on the
76
+ * way out.
77
+ *
78
+ * @param error - Error to check
79
+ * @returns True if the error was raised by application code
80
+ *
81
+ * @public
82
+ */
83
+ declare function isApplicationError(error: unknown): boolean;
67
84
  /**
68
85
  * Database error constructor options.
69
86
  *
@@ -102,4 +119,4 @@ interface DatabaseErrorOptions {
102
119
  */
103
120
  declare function createDatabaseError(options: DatabaseErrorOptions): DatabaseError;
104
121
 
105
- export { type DatabaseErrorKind as D, type DatabaseError as a, type DatabaseErrorOptions as b, createDatabaseError as c, isDatabaseError as i };
122
+ export { type DatabaseErrorKind as D, type DatabaseError as a, type DatabaseErrorOptions as b, createDatabaseError as c, isDatabaseError as d, isApplicationError as i };
@@ -64,6 +64,23 @@ interface DatabaseError extends Error {
64
64
  * @public
65
65
  */
66
66
  declare function isDatabaseError(error: unknown): error is DatabaseError;
67
+ /**
68
+ * Whether an error is the application's verdict rather than the database's
69
+ * failure.
70
+ *
71
+ * Work running inside a transaction may throw to roll the write back — a
72
+ * refused value, a permission denial — and such an error is not something the
73
+ * driver produced. Classifying it as a database error replaces its code and its
74
+ * payload with a generic one, so a caller that asked for a refusal is handed an
75
+ * unexplained failure instead, and per-field validation detail is lost on the
76
+ * way out.
77
+ *
78
+ * @param error - Error to check
79
+ * @returns True if the error was raised by application code
80
+ *
81
+ * @public
82
+ */
83
+ declare function isApplicationError(error: unknown): boolean;
67
84
  /**
68
85
  * Database error constructor options.
69
86
  *
@@ -102,4 +119,4 @@ interface DatabaseErrorOptions {
102
119
  */
103
120
  declare function createDatabaseError(options: DatabaseErrorOptions): DatabaseError;
104
121
 
105
- export { type DatabaseErrorKind as D, type DatabaseError as a, type DatabaseErrorOptions as b, createDatabaseError as c, isDatabaseError as i };
122
+ export { type DatabaseErrorKind as D, type DatabaseError as a, type DatabaseErrorOptions as b, createDatabaseError as c, isDatabaseError as d, isApplicationError as i };