{"id":42615,"library":"dblink-core","title":"dblink-core","description":"A core library for the DbLink ORM providing foundational data handling capabilities for database operations. Current stable version: 1.4.1 (not frequently updated, likely in maintenance mode). It serves as the base for DbLink ORM, offering a thin abstraction over database drivers. No significant differentiators from established ORMs like TypeORM or Sequelize; primarily for internal use within the DbLink ecosystem.","status":"maintenance","version":"1.4.1","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","typescript"],"install":[{"cmd":"npm install dblink-core","lang":"bash","label":"npm"},{"cmd":"yarn add dblink-core","lang":"bash","label":"yarn"},{"cmd":"pnpm add dblink-core","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"DbLinkCore is a named export, not a default export. Use named import syntax.","wrong":"import DbLinkCore from 'dblink-core'","symbol":"DbLinkCore","correct":"import { DbLinkCore } from 'dblink-core'"},{"note":"ESM library; CommonJS require() still works with named destructuring.","wrong":"const CoreHandler = require('dblink-core').CoreHandler","symbol":"CoreHandler","correct":"import { CoreHandler } from 'dblink-core'"},{"note":"Exact function name is createClient; no alias needed.","wrong":"import { clientFactory as createClient } from 'dblink-core'","symbol":"createClient","correct":"import { createClient } from 'dblink-core'"}],"quickstart":{"code":"import { createClient, CoreHandler } from 'dblink-core';\n\nconst config = {\n  host: process.env.DB_HOST ?? 'localhost',\n  port: parseInt(process.env.DB_PORT ?? '5432'),\n  user: process.env.DB_USER ?? 'postgres',\n  password: process.env.DB_PASSWORD ?? '',\n  database: process.env.DB_NAME ?? 'test'\n};\n\nasync function main() {\n  const client = createClient(config);\n  const handler = new CoreHandler(client);\n  const result = await handler.execute('SELECT NOW()');\n  console.log(result);\n  await client.close();\n}\n\nmain().catch(console.error);","lang":"typescript","description":"Demonstrates creating a database client and executing a query with CoreHandler using environment variables for configuration."},"warnings":[{"fix":"Wrap client creation with a singleton pattern or use external pooling library.","message":"The createClient function does not support connection pooling by default; each call creates a new connection.","severity":"gotcha","affected_versions":"all"},{"fix":"Use a dedicated query builder or escape inputs manually. In future versions, parameterized queries may be added.","message":"CoreHandler.execute() does not support parameterized queries; prone to SQL injection if using string interpolation.","severity":"gotcha","affected_versions":"<=1.4.1"},{"fix":"Replace any usage of handler.query() with handler.execute().","message":"The older method 'query()' on CoreHandler is deprecated in favor of 'execute()'.","severity":"deprecated","affected_versions":">=1.4.0"},{"fix":"Use import { DbLinkCore } from 'dblink-core' instead of default import.","message":"DbLinkCore exports both CommonJS and ESM builds but the default export is inconsistent; always use named imports.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"search_vec":"'1.4.1':22 'abstract':41 'base':34 'capabl':15 'core':3,5 'current':19 'data':13 'databas':17,43 'dblink':2,9,36,61 'dblink-cor':1 'differenti':47 'driver':44 'ecosystem':62 'establish':49 'foundat':12 'frequent':24 'handl':14 'intern':57 'javascript':63 'librari':6 'like':26,51 'mainten':28 'mode':29 'offer':38 'oper':18 'orm':10,37,50 'primarili':55 'provid':11 'sequel':54 'serv':31 'signific':46 'stabl':20 'thin':40 'typeorm':52 'typescript':64 'updat':25 'use':58 'version':21 'within':59","created_at":"2026-06-05T16:55:50.866766+00:00","updated_at":"2026-06-05T16:55:50.866766+00:00","problems":[{"fix":"Install with 'npm install dblink-core'. For bundlers, ensure package is in node_modules and imports are correct.","cause":"Missing package installation or bundler not resolving correctly.","error":"Cannot find module 'dblink-core'"},{"fix":"Check that you instantiated CoreHandler with a valid client. Use execute() as shown in examples.","cause":"Using deprecated query() method or incorrect import of CoreHandler.","error":"TypeError: core_handler.execute is not a function"},{"fix":"Verify environment variables DB_HOST and DB_PORT, and ensure database is accessible.","cause":"Database host/port incorrect or service not running.","error":"Error: Connection refused (ECONNREFUSED)"},{"fix":"Use bundler (e.g., esbuild, webpack) or set type: 'module' in package.json. For Node CommonJS, use dynamic import() or switch to TypeScript.","cause":"CommonJS environment without transpilation; package uses ESM.","error":"SyntaxError: Unexpected token 'export'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":"dblink-core","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-05","next_check":"2026-09-03","install_tag":null}}