@log-ingestor/mssql 0.3.0 → 0.3.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/README.md CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  Disk-first Node.js logger with automatic ingestion into Microsoft SQL Server — no ELK, no log management headaches.
4
4
 
5
+ ⚠️ **MSSQL database name is mandatory in the connection string.**
5
6
  This package is the **MSSQL adapter** for the `log-ingestor` ecosystem.
6
7
  It writes structured logs to disk and reliably ingests them into **Microsoft SQL Server** using a high‑performance background ingestor.
7
8
 
@@ -58,7 +59,13 @@ const logger = createLogger({
58
59
  },
59
60
  db: {
60
61
  type: "mssql",
61
- connection: process.env.MSSQL_CONNECTION
62
+ connection:
63
+ "Server=localhost,1433;" +
64
+ "Database=logsdb;" +
65
+ "User Id=sa;" +
66
+ "Password=***;" +
67
+ "Encrypt=true;" +
68
+ "TrustServerCertificate=true;"
62
69
  },
63
70
  batch: {
64
71
  size: 200
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@log-ingestor/mssql",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "Disk-first structured logger for Node.js with local ingestion to Microsoft SQL Server (MSSQL)",
5
5
  "license": "MIT",
6
6
  "private": false,
package/src/config.js CHANGED
@@ -7,10 +7,16 @@ function buildIngestorConfig({ logDir, db, batch }) {
7
7
  throw new Error("db.type and db.connection are required");
8
8
  }
9
9
 
10
+ if (!/Database=/i.test(db.connection)) {
11
+ throw new Error(
12
+ "MSSQL connection string must include Database=<db_name>"
13
+ );
14
+ }
15
+
10
16
  return {
11
17
  logDir,
12
18
  db: {
13
- type: db.type,
19
+ type: db.type,
14
20
  connection: db.connection,
15
21
  table: db.table || "unified_logs"
16
22
  },