Registry / database / lsif-sqlite

lsif-sqlite

JSON →
library0.5.3jsnpmunverified

Converts LSIF (Language Server Index Format) dumps into SQLite databases for querying code intelligence data offline. Stable version 0.5.3, part of the lsif-node project by Microsoft. Accepts LSIF input files and produces a SQLite DB enabling efficient multi-file analysis. Differentiated from other LSIF tools by its focus on SQL persistence rather than in-memory processing.

npm install lsif-sqlite
INSTALL
IMPORT
SIG · LSIF-SQLITE
L
lsif-sqlite
databasejavascriptv0.5.3
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

main
import { lsifSqlite } from 'lsif-sqlite'
const lsifSqlite = require('lsif-sqlite')
ESM-only; CJS require will fail. The package exports a main function.
convertToDb
import { convertToDb } from 'lsif-sqlite'
import convertToDb from 'lsif-sqlite'
Named export, not default.
transform
import { transform } from 'lsif-sqlite'
const transform = require('lsif-sqlite').transform
Named export; available only in ESM context.
LSIFDatabase
import { LSIFDatabase } from 'lsif-sqlite'
import LSIFDatabase from 'lsif-sqlite'
TypeScript type export; for type annotations only.

Converts an LSIF dump file stream into a SQLite database using the main convertToDb function.

import { convertToDb } from 'lsif-sqlite'; import { createReadStream } from 'fs'; import { open } from 'sqlite'; import sqlite3 from 'sqlite3'; async function main() { const lsifInput = createReadStream('dump.lsif'); const db = await open({ filename: 'output.db', driver: sqlite3.Database }); await convertToDb(lsifInput, db); console.log('Conversion complete'); await db.close(); } main().catch(console.error);
Debug
Known issues
breakingIn version 0.4.0, the API changed from callback-based to promise-based. Old code using callbacks will break.
fix
Use async/await or .then() with the new API.
affects: >=0.4 <0.5
deprecatedThe 'transform' function is deprecated in 0.5.0; use 'convertToDb' instead.
fix
Replace transform() with convertToDb() for new code.
affects: >=0.5
gotchaThe package expects LSIF v1.0 format. Using older or newer versions may cause parsing errors.
fix
Ensure LSIF dump is compatible with LSIF v1.0 specification.
affects: >=0.3
gotchasqlite3 native module may fail to build on some Node versions. Pre-built binaries are not provided.
fix
Install build tools (python, make, g++) or use 'sql.js' as an alternative.
affects: all
gotchaLarge LSIF dumps (>500MB) may cause out-of-memory errors because the entire input is loaded into memory before processing.
fix
Use streaming and chunking manually, or split the LSIF dump into smaller parts.
affects: all
Errors
Common errors & fixes
Error: Cannot find module 'lsif-sqlite'
Package not installed or not in node_modules.
fix
Run 'npm install lsif-sqlite' in your project directory.
TypeError: (0 , lsif_sqlite.convertToDb) is not a function
Incorrect import syntax (CommonJS require used with ESM-only package).
fix
Use 'import { convertToDb } from 'lsif-sqlite'' in an ESM context (type: module in package.json or .mjs file).
Error: SQLITE_ERROR: no such table: meta
The SQLite database schema is not created or is outdated.
fix
Ensure you use the latest version of the package and run the conversion on a fresh database.
Upgrade
Version history
0.5.3latest on npm
Audit
Dependencies
sqlite3requiredProvides the SQLite database interface for storing LSIF data
progressoptionalShows progress bars during conversion
Agent activity
6 hits · last 30 days
node
4
Resources
lsif-sqlite — npm install lsif-sqlite · libregistry