{"id":46467,"library":"sqlite-lines","title":"sqlite-lines","description":"A SQLite extension for line-by-line file processing within SQL queries, distributed as an npm package for Node.js. Version 0.2.2 provides pre-compiled binaries for darwin-x64, win32-x64, and linux-x64. The extension allows reading, splitting, and generating lines from files or text directly in SQL, with functions like lines_read(), lines_split(), and lines_version(). Use with better-sqlite3 or node-sqlite3 via db.loadExtension(getLoadablePath()). No prebuilt binaries for ARM or musl Linux.","status":"active","version":"0.2.2","language":"javascript","source_language":"en","source_url":"https://github.com/asg017/sqlite-lines","tags":["javascript"],"install":[{"cmd":"npm install sqlite-lines","lang":"bash","label":"npm"},{"cmd":"yarn add sqlite-lines","lang":"bash","label":"yarn"},{"cmd":"pnpm add sqlite-lines","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Common SQLite client used to load extension","package":"better-sqlite3","optional":true},{"reason":"Alternative SQLite client used to load extension","package":"sqlite3","optional":true}],"imports":[{"note":"Package exports only getLoadablePath via named export; default export is not available.","wrong":"const { getLoadablePath } = require('sqlite-lines');","symbol":"getLoadablePath","correct":"import * as sqlite_lines from 'sqlite-lines'; const path = sqlite_lines.getLoadablePath();"},{"note":"SQL function available only after loading extension. Not exported from npm package itself.","wrong":"","symbol":"lines_version()","correct":"db.loadExtension(require('sqlite-lines').getLoadablePath());\ndb.prepare(\"SELECT lines_version()\").pluck().get();"},{"note":"CommonJS import works; the package exports the getLoadablePath function directly, no default export.","wrong":"const sqlite_lines = require('sqlite-lines').default;","symbol":"require('sqlite-lines')","correct":"const sqlite_lines = require('sqlite-lines');"}],"quickstart":{"code":"import Database from 'better-sqlite3';\nimport * as sqlite_lines from 'sqlite-lines';\n\nconst db = new Database(':memory:');\ndb.loadExtension(sqlite_lines.getLoadablePath());\n\nconst version = db.prepare('SELECT lines_version()').pluck().get();\nconsole.log('lines_version:', version);\n\n// read lines from a file\nconst lines = db.prepare('SELECT * FROM lines_read(?)').all('/path/to/file.txt');\nconsole.log(lines);","lang":"typescript","description":"Shows how to load the sqlite-lines extension into better-sqlite3, check the version, and read lines from a file."},"warnings":[{"fix":"Use on one of those platforms or may fail to load extension with unsupported platform error.","message":"Pre-compiled binaries only for darwin-x64, win32-x64, linux-x64","severity":"breaking","affected_versions":">=0.0.0"},{"fix":"Ensure npm install downloads the correct platform-specific package (e.g., sqlite-lines-darwin-x64).","message":"getLoadablePath() returns an absolute path; must be called after package installation, and the correct optional dependency must be installed automatically","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Use db.loadExtension() before running any sqlite-lines SQL functions.","message":"Extension functions (lines_read, lines_split, etc.) are only available after loading the extension into a database connection; not exposed directly via JS","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Check migration notes when upgrading to v1.x.","message":"The package may be renamed or moved; current version 0.2.x API subject to change","severity":"deprecated","affected_versions":"<=0.2.2"}],"env_vars":null,"search_vec":"'0.2.2':25 'allow':44 'arm':83 'better':70 'better-sqlite3':69 'binari':30,81 'compil':29 'darwin':33 'darwin-x64':32 'db.loadextension':77 'direct':54 'distribut':17 'extens':6,43 'file':12,51 'function':58 'generat':48 'getloadablepath':78 'javascript':87 'like':59 'line':3,9,11,49,60,62,65 'line-by-lin':8 'linux':40,86 'linux-x64':39 'musl':85 'node':74 'node-sqlite3':73 'node.js':23 'npm':20 'packag':21 'pre':28 'pre-compil':27 'prebuilt':80 'process':13 'provid':26 'queri':16 'read':45,61 'split':46,63 'sql':15,56 'sqlite':2,5 'sqlite-lin':1 'sqlite3':71,75 'text':53 'use':67 'version':24,66 'via':76 'win32':36 'win32-x64':35 'within':14 'x64':34,37,41","created_at":"2026-06-07T13:00:03.734411+00:00","updated_at":"2026-06-07T13:00:03.734411+00:00","problems":[{"fix":"Verify platform support; if on unsupported platform (e.g., ARM Mac), use a different approach or container.","cause":"Missing or incorrect platform-specific binary; binary not found for current OS/arch","error":"Error: dlopen(libsqlite-lines.so): image not found"},{"fix":"Run npm install sqlite-lines again, or check npm registry and network connectivity.","cause":"Package not installed or optional dependencies failed to download","error":"Error: Cannot find module 'sqlite-lines'"},{"fix":"Install Visual C++ Redistributable for Visual Studio 2015-2022.","cause":"On Windows, binary not found or dependencies missing (e.g., Visual C++ Redistributable)","error":"Error: The specified module could not be found"}],"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/asg017/sqlite-lines#readme","github":"https://github.com/asg017/sqlite-lines","docs":null,"changelog":null,"pypi":null,"npm":"sqlite-lines","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-07","next_check":"2026-09-05","install_tag":null}}