@mlagie/sql-connector 2.0.0 → 2.0.1
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.
- package/package.json +1 -2
- package/releases/2.0.1.md +23 -0
- package/src/models/Model.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mlagie/sql-connector",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "Le module sql-connector permet de gérer les connexions à une base de données MySQL, de définir des schémas de tables, et d'interagir avec les données de manière simple et efficace.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -36,7 +36,6 @@
|
|
|
36
36
|
"private": false,
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@mlagie/logger": "1.0.2",
|
|
39
|
-
"glob": "^13.0.6",
|
|
40
39
|
"mysql2": "3.22.5"
|
|
41
40
|
},
|
|
42
41
|
"devDependencies": {
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Release v2.0.1 — Hotfix: Application Launch Crash (Variable Reference Error)
|
|
2
|
+
|
|
3
|
+
This patch release resolves a critical regression introduced in `v2.0.0` that completely blocked applications from starting when using `@mlagie/sql-connector`.
|
|
4
|
+
|
|
5
|
+
## Problem
|
|
6
|
+
|
|
7
|
+
Upon initializing the package or starting the parent application, a runtime crash occurred due to an undefined or incorrectly scoped variable. This prevented the ORM from establishing connections and loading models properly, causing the host application to crash immediately on boot.
|
|
8
|
+
|
|
9
|
+
## What Was Fixed
|
|
10
|
+
|
|
11
|
+
* **Variable Scope Resolution:** Fixed the broken variable reference causing the startup crash during initialization.
|
|
12
|
+
* **Boot Reliability:** Restored seamless application launches when importing and configuring the SQL connector.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## 📦 Component Impact
|
|
17
|
+
|
|
18
|
+
| Impacted Area | Description | Status |
|
|
19
|
+
| :--- | :--- | :--- |
|
|
20
|
+
| **Core Initialization** | Uncaught reference/variable error blocking `npm start` | **Fixed** |
|
|
21
|
+
| **Stability** | Application crash on package import | **Resolved** |
|
|
22
|
+
|
|
23
|
+
*If you encountered initialization errors with v2.0.0, please upgrade your dependency to v2.0.1 immediately.* `npm update @mlagie/sql-connector`
|
package/src/models/Model.js
CHANGED
|
@@ -224,7 +224,7 @@ class Model {
|
|
|
224
224
|
generateCreateTableStatement(schema) {
|
|
225
225
|
let foreignKey = [];
|
|
226
226
|
const columns = Object.keys(schema).map(fieldName => {
|
|
227
|
-
|
|
227
|
+
const field = getSafe(schema, fieldName);
|
|
228
228
|
let lengthDefault = 255;
|
|
229
229
|
|
|
230
230
|
if (!field.type && typeof field == "object" && !(Array.isArray(field.enum) && field.enum.length > 0)) throw new Error(`Field ${fieldName} has no type defined.`);
|