{"id":20733747,"url":"https://github.com/pageton/sqlitekv","last_synced_at":"2026-02-14T20:34:51.706Z","repository":{"id":251226226,"uuid":"836781526","full_name":"pageton/SQLiteKV","owner":"pageton","description":"SQLiteKV is a lightweight key-value store built on top of SQLite3, offering basic key-value operations with support for expiry times, JSON export, and flexible storage options including in-memory, temporary, and disk-based storage. Ideal for applications requiring persistent and reliable storage.","archived":false,"fork":false,"pushed_at":"2024-08-05T04:35:08.000Z","size":85,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-07T14:41:14.208Z","etag":null,"topics":["database","javascript","key-value-database","key-value-store","npm","pnpm","sql","sqlite","sqlite3","sqlitekv","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pageton.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-01T14:43:02.000Z","updated_at":"2024-08-05T04:35:11.000Z","dependencies_parsed_at":"2024-08-01T16:46:03.562Z","dependency_job_id":"65a32316-c49e-45fb-ae0b-385fa67817a0","html_url":"https://github.com/pageton/SQLiteKV","commit_stats":null,"previous_names":["dev-rio/sqlitekv"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pageton/SQLiteKV","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pageton%2FSQLiteKV","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pageton%2FSQLiteKV/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pageton%2FSQLiteKV/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pageton%2FSQLiteKV/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pageton","download_url":"https://codeload.github.com/pageton/SQLiteKV/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pageton%2FSQLiteKV/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29455358,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T15:52:44.973Z","status":"ssl_error","status_checked_at":"2026-02-14T15:52:11.208Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","javascript","key-value-database","key-value-store","npm","pnpm","sql","sqlite","sqlite3","sqlitekv","typescript"],"created_at":"2024-11-17T05:26:53.628Z","updated_at":"2026-02-14T20:34:51.689Z","avatar_url":"https://github.com/pageton.png","language":"TypeScript","readme":"# SQLiteKV\n\nSQLiteKV is a key-value store built on top of SQLite3. This project allows you to perform basic key-value operations with the additional power of SQLite3, making it suitable for applications requiring persistent, lightweight, and reliable storage.\n\n## Features\n\n-   Basic key-value operations: set, get, delete, exists, keys\n-   Support for expiry times on keys\n-   JSON export of the database\n-   Loop operations for repetitive tasks\n-   Transaction management\n-   Flexible journal modes (WAL, DELETE, etc.)\n-   In-memory, temporary, and disk-based storage options\n-   Logger mode to track executed SQL queries\n\n## Installation\n\nYou can install the package by running the following command with `npm`:\n\n```sh\nnpm install sqlitekv\n```\n\nOr with `pnpm`:\n\n```sh\npnpm install sqlitekv\n```\n\n## Usage\n\n### Basic Setup\n\nHere is an example of how to set up and use the SQLiteKV store:\n\n```typescript\nimport SQLiteKV from \"sqlitekv\";\n\n(async () =\u003e {\n    try {\n        // Initialize the database with configuration\n        const db = new SQLiteKV(\"example.sqlite\", {\n            tableName: \"example_table\",\n            autoCommit: true,\n            journalMode: \"WAL\",\n            enableLoopOperations: true,\n            logQueries: true\n        });\n\n        // Perform some operations\n        await db.set(\"key1\", \"value1\");\n        const value = await db.get(\"key1\");\n        console.log(`Retrieved value for key1: ${value}`);\n\n        // Check if a key exists\n        const exists = await db.exists(\"key1\");\n        console.log(`Key1 exists: ${exists}`);\n\n        // Delete a key\n        await db.delete(\"key1\");\n        console.log(`Key1 deleted`);\n\n        // Export the database to JSON\n        await db.convertToJson(\"export.json\");\n        console.log(\"Database exported to export.json\");\n    } catch (error) {\n        console.error(\"Error initializing database:\", error);\n    }\n})();\n```\n\nYou can also initialize the database without passing the configuration object:\n\n```typescript\nimport SQLiteKV from \"sqlitekv\";\n\n(async () =\u003e {\n    try {\n        // Initialize the database with default settings\n        const db = new SQLiteKV(\"example.sqlite\");\n\n        // Perform some operations\n        await db.set(\"key1\", \"value1\");\n        const value = await db.get(\"key1\");\n        console.log(`Retrieved value for key1: ${value}`);\n\n        // Check if a key exists\n        const exists = await db.exists(\"key1\");\n        console.log(`Key1 exists: ${exists}`);\n\n        // Delete a key\n        await db.delete(\"key1\");\n        console.log(`Key1 deleted`);\n\n        // Export the database to JSON\n        await db.convertToJson(\"export.json\");\n        console.log(\"Database exported to export.json\");\n    } catch (error) {\n        console.error(\"Error initializing database:\", error);\n    }\n})();\n```\n\n### Loop Operations\n\nIf you need to perform a set of operations repeatedly, you can use the loop operations feature:\n\n```typescript\nconst operations = async () =\u003e {\n    const timestamp = new Date().toISOString();\n    await db.set(`test_key_${timestamp}`, `test_value_${timestamp}`);\n    console.log(\n        `Set key: test_key_${timestamp} with value: test_value_${timestamp}`\n    );\n};\n\nconst iterations = 10;\nawait db.performLoopOperations(operations, iterations);\n```\n\n## Configuration Options\n\nYou can customize the behavior of SQLiteKV using the following configuration options:\n\n-   `tableName`: The name of the table used for storing key-value pairs.\n-   `autoCommit`: Whether to automatically commit transactions.\n-   `journalMode`: The journal mode for SQLite (e.g., WAL, DELETE).\n-   `sqliteMode`: The storage mode for SQLite (disk, memory, temp).\n-   `logQueries`: Whether to log executed SQL queries.\n-   `enableLoopOperations`: Whether to enable loop operations.\n\n## Viewing the SQLite Database\n\nYou can view and interact with the SQLite database using an online viewer such as [SQLite Viewer](https://sqlite3.online/).\n\n## Similar Projects\n\nThere is a similar project in Python, which you can check out here: [Kvsqlite](https://github.com/AYMENJD/Kvsqlite).\n\n## License\n\nThis project is licensed under the MIT License.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpageton%2Fsqlitekv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpageton%2Fsqlitekv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpageton%2Fsqlitekv/lists"}