{"id":43978,"library":"sqlanywhere","title":"sqlanywhere (SAP SQL Anywhere)","description":"Node.js native driver for SAP SQL Anywhere databases, supporting direct execution, prepared statements, and connection pooling. Latest version 1.0.27 supports Node.js 5–12, but development appears stalled with no releases since 2019. Requires native compilation via node-gyp; prebuilt binaries only for Windows 64-bit. Compared to generic ODBC drivers, this offers tighter integration with SQL Anywhere-specific features like auto-starting databases and connection properties, but at the cost of limited platform and Node version support. The API is callback-based; no Promise or async/await support.","status":"maintenance","version":"1.0.27","language":"javascript","source_language":"en","source_url":"https://github.com/sqlanywhere/node-sqlanywhere","tags":["javascript"],"install":[{"cmd":"npm install sqlanywhere","lang":"bash","label":"npm"},{"cmd":"yarn add sqlanywhere","lang":"bash","label":"yarn"},{"cmd":"pnpm add sqlanywhere","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The package is CJS-only; ESM import will fail because there is no default export.","wrong":"import sqlanywhere from 'sqlanywhere';","symbol":"sqlanywhere","correct":"const sqlanywhere = require('sqlanywhere');"},{"note":"createConnection is a factory function, not a constructor. Do not use 'new'.","wrong":"const conn = new sqlanywhere.Connection();","symbol":"createConnection","correct":"const conn = sqlanywhere.createConnection();"},{"note":"Connection parameters must be passed as an object, not a connection string.","wrong":"conn.connect('Server=demo;UserId=DBA;Password=sql', callback);","symbol":"connect","correct":"conn.connect({ Server: 'demo', UserId: 'DBA', Password: 'sql' }, callback);"}],"quickstart":{"code":"const sqlanywhere = require('sqlanywhere');\nconst conn = sqlanywhere.createConnection();\nconst conn_params = {\n  Server: 'demo16',\n  UserId: 'DBA',\n  Password: 'sql'\n};\nconn.connect(conn_params, (err) => {\n  if (err) throw err;\n  conn.exec('SELECT Name, Description FROM Products WHERE id = ?', [301], (err, result) => {\n    if (err) throw err;\n    console.log('Name:', result[0].Name, ', Description:', result[0].Description);\n    conn.disconnect();\n  });\n});","lang":"javascript","description":"Connect to a SQL Anywhere database and execute a parameterized query with a callback."},"warnings":[{"fix":"Install node-gyp and ensure SQL Anywhere SDK is available. Alternatively, use a cross-platform ODBC driver.","message":"The package only ships precompiled native binaries for Windows 64-bit. On Linux or macOS, you must have a full C++ toolchain and SQL Anywhere client SDK installed to compile from source.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use an older Node.js version (12.x) or migrate to a maintained driver like tedious (for MSSQL) or ODBC.","message":"LTS releases of Node.js beyond version 12 (e.g., 14, 16, 18) are not supported. The last release (1.0.27) only officially supports Node.js 5 through 12.","severity":"deprecated","affected_versions":"<=1.0.27"},{"fix":"Check the documentation for the type of statement being executed; handle all three cases in your callback.","message":"The callback pattern is inconsistent: conn.exec for DDL returns no result (undefined), for DML returns affectedRows (number), and for queries returns an array of rows. Mixing these up can cause runtime errors.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Upgrade Node.js to at least 5.x (max 12.x) or pin to sqlanywhere@1.0.23.","message":"Version 1.0.24 dropped support for Node.js 0.10, 0.12, and 4.x. Packages relying on those versions will break.","severity":"breaking","affected_versions":">=1.0.24"}],"env_vars":null,"search_vec":"'1.0.27':23 '12':27 '2019':36 '5':26 '64':49 'anywher':4,11,63 'anywhere-specif':62 'api':86 'appear':30 'async/await':94 'auto':68 'auto-start':67 'base':90 'binari':45 'bit':50 'callback':89 'callback-bas':88 'compar':51 'compil':39 'connect':19,72 'cost':77 'databas':12,70 'develop':29 'direct':14 'driver':7,55 'execut':15 'featur':65 'generic':53 'gyp':43 'integr':59 'javascript':96 'latest':21 'like':66 'limit':79 'nativ':6,38 'node':42,82 'node-gyp':41 'node.js':5,25 'odbc':54 'offer':57 'platform':80 'pool':20 'prebuilt':44 'prepar':16 'promis':92 'properti':73 'releas':34 'requir':37 'sap':2,9 'sinc':35 'specif':64 'sql':3,10,61 'sqlanywher':1 'stall':31 'start':69 'statement':17 'support':13,24,84,95 'tighter':58 'version':22,83 'via':40 'window':48","created_at":"2026-06-05T17:02:23.754468+00:00","updated_at":"2026-06-05T17:02:23.754468+00:00","problems":[{"fix":"Ensure build tools are installed (node-gyp, Python, C++ compiler) and run 'npm rebuild sqlanywhere'. On Windows 64-bit, reinstall the exact version with npm.","cause":"The native addon (sqlanywhere.node) is missing; node-gyp build failed or precompiled binary not available.","error":"Error: Could not locate the bindings file. Tried: ..."},{"fix":"Verify server name or Host, and ensure the database server is accessible. For local databases, use DatabaseFile with AutoStart: 'YES'.","cause":"The connection parameters are incorrect or the SQL Anywhere server is not running on the specified host/port.","error":"Error: connect: database server not found"},{"fix":"Ensure you use 'const sqlanywhere = require('sqlanywhere');' and then 'const conn = sqlanywhere.createConnection();'. The exec method is only available after createConnection.","cause":"The connection object is not properly initialized; likely using an older API version or incorrect import.","error":"TypeError: conn.exec is not a function"}],"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":"https://github.com/sqlanywhere/node-sqlanywhere#readme","github":"https://github.com/sqlanywhere/node-sqlanywhere","docs":null,"changelog":null,"pypi":null,"npm":"sqlanywhere","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}}