{"id":46311,"library":"schema-seed-adapter-sqlite","title":"schema-seed SQLite Adapter","description":"SQLite adapter for the schema-seed test data seeding library (v0.1.11). Automatically loaded by the schema-seed CLI when a SQLite connection string is provided. Enables SQLite database seeding with schema-seed's schema-driven approach. Released under active development with TypeScript type definitions. Key differentiator: built specifically for schema-seed's adapter-based architecture, simplifying SQLite integration compared to writing custom seeding logic with better-sqlite3 or sql.js.","status":"active","version":"0.1.11","language":"javascript","source_language":"en","source_url":"https://github.com/alinazar-111/schema-seed","tags":["javascript","database","seeding","test-data","adapter","schema-seed","typescript"],"install":[{"cmd":"npm install schema-seed-adapter-sqlite","lang":"bash","label":"npm"},{"cmd":"yarn add schema-seed-adapter-sqlite","lang":"bash","label":"yarn"},{"cmd":"pnpm add schema-seed-adapter-sqlite","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core library that provides CLIs and schema-based seeding. This adapter is used with schema-seed.","package":"schema-seed","optional":false},{"reason":"SQLite database driver used for database operations.","package":"better-sqlite3","optional":false}],"imports":[{"note":"The adapter is a named export, not a default export.","wrong":"import SqliteAdapter from 'schema-seed-adapter-sqlite'","symbol":"SqliteAdapter","correct":"import { SqliteAdapter } from 'schema-seed-adapter-sqlite'"},{"note":"CommonJS require must destructure the named export.","wrong":"const SqliteAdapter = require('schema-seed-adapter-sqlite')","symbol":"SqliteAdapter","correct":"const { SqliteAdapter } = require('schema-seed-adapter-sqlite')"},{"note":"For TypeScript type-only imports, use 'import type' to avoid bundling runtime code.","wrong":"import { SqliteAdapter } from 'schema-seed-adapter-sqlite' (when only type is needed)","symbol":"SqliteAdapter","correct":"import type { SqliteAdapter } from 'schema-seed-adapter-sqlite'"}],"quickstart":{"code":"import { Seeder } from 'schema-seed';\nimport { SqliteAdapter } from 'schema-seed-adapter-sqlite';\nimport Database from 'better-sqlite3';\n\nconst db = new Database(':memory:');\nconst adapter = new SqliteAdapter(db);\nconst seeder = new Seeder(adapter, {\n  users: {\n    schema: {\n      id: 'increment',\n      name: 'first name',\n      email: 'email',\n    },\n    count: 10,\n  },\n});\n\nawait seeder.seed();\nconsole.log('Seeded 10 users into SQLite in-memory database.');","lang":"typescript","description":"Creates an in-memory SQLite database, seeds 10 users with auto-incrementing IDs, first names, and emails using schema-seed."},"warnings":[{"fix":"Use ES modules (import) or set type: \"module\" in package.json.","message":"Adapter is only available as ESM; CommonJS require may fail if not using Node.js >= 12 or if the package does not have a proper CJS build. Check exports.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Use better-sqlite3 exclusively. Example: const Database = require('better-sqlite3'); const db = new Database(path);","message":"The SqliteAdapter constructor expects a better-sqlite3 Database instance. Passing a sql.js or other driver will cause runtime errors.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Use named import: import { SqliteAdapter } from 'schema-seed-adapter-sqlite'","message":"In version 0.1.0, the adapter exported as default export. This changed to named export in 0.1.1.","severity":"breaking","affected_versions":">=0.1.1"}],"env_vars":null,"search_vec":"'activ':48 'adapt':5,7,64,88 'adapter-bas':63 'approach':45 'architectur':66 'automat':18 'base':65 'better':78 'better-sqlite3':77 'built':56 'cli':25 'compar':70 'connect':29 'custom':73 'data':14,87 'databas':35,83 'definit':53 'develop':49 'differenti':55 'driven':44 'enabl':33 'integr':69 'javascript':82 'key':54 'librari':16 'load':19 'logic':75 'provid':32 'releas':46 'schema':2,11,23,39,43,60,90 'schema-driven':42 'schema-se':1,10,22,38,59,89 'seed':3,12,15,24,36,40,61,74,84,91 'simplifi':67 'specif':57 'sql.js':81 'sqlite':4,6,28,34,68 'sqlite3':79 'string':30 'test':13,86 'test-data':85 'type':52 'typescript':51,92 'v0.1.11':17 'write':72","created_at":"2026-06-07T12:59:18.902774+00:00","updated_at":"2026-06-07T12:59:18.902774+00:00","problems":[{"fix":"Change import to: import { SqliteAdapter } from 'schema-seed-adapter-sqlite'","cause":"Using default import when only named export exists.","error":"TypeError: SqliteAdapter is not a constructor"},{"fix":"Install better-sqlite3: npm install better-sqlite3","cause":"better-sqlite3 is a peer dependency and not installed automatically.","error":"Error: Cannot find module 'better-sqlite3'"},{"fix":"Use adapter with Seeder: const seeder = new Seeder(adapter, config); await seeder.seed();","cause":"Calling seed on adapter instance instead of Seeder instance.","error":"The 'SqliteAdapter' class does not have a 'seed' method."},{"fix":"Ensure you are using better-sqlite3: const Database = require('better-sqlite3'); const db = new Database(path);","cause":"Passing a sql.js database instance instead of better-sqlite3.","error":"TypeError: db.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/alinazar-111/schema-seed#readme","github":"https://github.com/alinazar-111/schema-seed","docs":null,"changelog":null,"pypi":null,"npm":"schema-seed-adapter-sqlite","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database","testing"],"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}}