{"id":46795,"library":"webadnan-npm-sqlite","title":"webadnan-npm-sqlite","description":"A minimal key-value store built on top of SQLite, version 1.0.7. It exposes a simple async getter/setter API (set, get, size, run) and automatically creates a SQLite database file if one doesn't exist at the given path. This package is a lightweight wrapper around better-sqlite3, intended for small-scale projects where a full ORM is overkill. Last updated with no recent release cadence; likely a personal utility.","status":"active","version":"1.0.7","language":"javascript","source_language":"en","source_url":null,"tags":["javascript"],"install":[{"cmd":"npm install webadnan-npm-sqlite","lang":"bash","label":"npm"},{"cmd":"yarn add webadnan-npm-sqlite","lang":"bash","label":"yarn"},{"cmd":"pnpm add webadnan-npm-sqlite","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"synchronous SQLite3 driver used internally","package":"better-sqlite3","optional":false}],"imports":[{"note":"Package is CommonJS only; ESM import will fail.","wrong":"import Sqlite from 'webadnan-npm-sqlite';","symbol":"Sqlite","correct":"const Sqlite = require('webadnan-npm-sqlite');"},{"note":"The main export is a class via module.exports, not a named export.","wrong":"const { Sqlite } = require('webadnan-npm-sqlite');","symbol":"Sqlite","correct":"const { default: Sqlite } = require('webadnan-npm-sqlite');"},{"note":"TypeScript namespace import workaround; default import fails.","wrong":"import * as Sqlite from 'webadnan-npm-sqlite';","symbol":"Sqlite","correct":"import Sqlite = require('webadnan-npm-sqlite');"}],"quickstart":{"code":"const Sqlite = require('webadnan-npm-sqlite');\n\nasync function main() {\n  const db = new Sqlite();\n  await db.connect('./test.sqlite');\n  await db.set('greeting', 'Hello, World!');\n  const value = await db.get('greeting');\n  console.log(value); // 'Hello, World!'\n  console.log(await db.size()); // 1\n  await db.run('DROP TABLE IF EXISTS test');\n}\nmain().catch(console.error);","lang":"javascript","description":"Demonstrates key-value set/get, size query, and raw SQL execution using async/await."},"warnings":[{"fix":"Use try-catch around every async call and check for null returns.","message":"All methods are asynchronous but use better-sqlite3 synchronously under the hood. The promises are artificial; errors might be swallowed on connection or query failure.","severity":"gotcha","affected_versions":"all"},{"fix":"Convert values to strings (e.g., JSON.stringify) before storing and parse on retrieval.","message":"The set/get methods only accept string values. Other types (numbers, booleans, objects) are not automatically serialized.","severity":"gotcha","affected_versions":"all"},{"fix":"Check package.json license and author before use.","message":"The package name is webadnan-npm-sqlite; there are many similarly named packages on npm. Ensure you install this exact name.","severity":"gotcha","affected_versions":"all"},{"fix":"Consider better-sqlite3 directly or a maintained wrapper like sqlite3 or sequelize.","message":"No version bumps since initial release; considered low maintenance. No TypeScript definitions or browser support.","severity":"deprecated","affected_versions":"all"}],"env_vars":null,"search_vec":"'1.0.7':17 'api':24 'around':51 'async':22 'automat':30 'better':53 'better-sqlite3':52 'built':11 'cadenc':73 'creat':31 'databas':34 'doesn':38 'exist':40 'expos':19 'file':35 'full':63 'get':26 'getter/setter':23 'given':43 'intend':55 'javascript':78 'key':8 'key-valu':7 'last':67 'lightweight':49 'like':74 'minim':6 'npm':3 'one':37 'orm':64 'overkil':66 'packag':46 'path':44 'person':76 'project':60 'recent':71 'releas':72 'run':28 'scale':59 'set':25 'simpl':21 'size':27 'small':58 'small-scal':57 'sqlite':4,15,33 'sqlite3':54 'store':10 'top':13 'updat':68 'util':77 'valu':9 'version':16 'webadnan':2 'webadnan-npm-sqlit':1 'wrapper':50","created_at":"2026-06-07T13:01:40.253955+00:00","updated_at":"2026-06-07T13:01:40.253955+00:00","problems":[{"fix":"Run: npm install better-sqlite3","cause":"Missing native SQLite driver dependency.","error":"Cannot find module 'better-sqlite3'"},{"fix":"Use: const db = new Sqlite();","cause":"Trying to call get before initializing the db object (missing new keyword).","error":"db.get is not a function"},{"fix":"Instantiate with new: const db = new Sqlite();","cause":"The package exports a class, not an object. Direct use of require() exports the class.","error":"TypeError: db.connect is not a function"},{"fix":"Run: npm install webadnan-npm-sqlite","cause":"Package not installed.","error":"Error: Cannot find module 'webadnan-npm-sqlite'"}],"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":"webadnan-npm-sqlite","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}}