jsHarmony Database Core library providing an ORM-like interface for database operations, focusing on SQL Server with support for schema definition, CRUD operations, and stored procedures. The current stable version is 1.14.2, released with periodic updates. Key differentiators include a flexible type system (DB.types) for column definitions, built-in connection pooling, and compatibility with jsHarmony framework. Unlike general ORMs, it emphasizes direct SQL control and integration with jsHarmony's application structure. It also provides utilities for database metadata scanning and migration.
npm install jsharmony-dbVerified import paths — ran on the pinned version, not inferred.
Establishes a SQL Server connection, runs a parameterized SELECT query, logs the first result, and closes the connection.
Always provide a callback (function(err) { ... }) to .open(). Remove any .openSync() usage.Replace new DB.ConnectionPool(config) with new DB.Connection(config).
Use DB.types.NVarChar(DB.types.MAX) for large strings.
Always use @paramName in SQL strings and .param('paramName', value).Implement retry logic manually or use a connection pool manager.
Ensure you are using const DB = require('jsharmony-db'); and version >=1.0.0. Try npm install jsharmony-db@latest.Use DB.types.BigInt, not types.BigInt alone.
Call conn.open(function(err) { ... }).Verify that every @param in SQL has a corresponding .param('param', value).