{"id":19068151,"url":"https://github.com/rahuldhole/idbsuit","last_synced_at":"2026-03-12T13:43:14.083Z","repository":{"id":239783244,"uuid":"800524656","full_name":"rahuldhole/IDBSuit","owner":"rahuldhole","description":"IndexedDB Suit for handling migrations and data models","archived":false,"fork":false,"pushed_at":"2025-06-12T06:52:30.000Z","size":208,"stargazers_count":0,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-18T21:49:48.109Z","etag":null,"topics":["database","indexeddb","offline-first","pwa"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rahuldhole.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-05-14T13:53:55.000Z","updated_at":"2025-06-06T09:46:51.000Z","dependencies_parsed_at":"2024-05-22T17:30:14.702Z","dependency_job_id":"f3f68ac5-0263-43af-a8ee-6bd9a9e7cb2c","html_url":"https://github.com/rahuldhole/IDBSuit","commit_stats":null,"previous_names":["rahuldhole/idbsuit"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rahuldhole/IDBSuit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rahuldhole%2FIDBSuit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rahuldhole%2FIDBSuit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rahuldhole%2FIDBSuit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rahuldhole%2FIDBSuit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rahuldhole","download_url":"https://codeload.github.com/rahuldhole/IDBSuit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rahuldhole%2FIDBSuit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276369642,"owners_count":25630264,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-22T02:00:08.972Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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","indexeddb","offline-first","pwa"],"created_at":"2024-11-09T01:06:08.525Z","updated_at":"2025-09-22T08:24:42.866Z","avatar_url":"https://github.com/rahuldhole.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# IDBSuit\n [![npm version](https://badge.fury.io/js/idbsuit.svg)](https://badge.fury.io/js/idbsuit) [![license](https://img.shields.io/npm/l/idbsuit.svg)](https://github.com/rahuldhole/IDBSuit/blob/main/LICENSE)\n ![publish workflow](https://github.com/rahuldhole/idbsuit/actions/workflows/cd.yml/badge.svg)\n\nIndexedDB Suit for handling migrations automatically and provide ORM.\n\nSample react project: https://github.com/rahuldhole/slick-pick\n\nIn your config directory create `IDBSuit.js` and update path to your `./migrations` folder and `Schema.js`\n\nNote: In IndexedDB all migrations are irreversible. If you need to reverse an immigration you may need to create another migration file\n\n```\n// IDBSuit.js\nimport { IDBS } from 'idbsuit'; // package\n\n// Change your Schema.js path\nimport { Schema } from './Schema';\n\n// change your migrations/ folder path\nconst reqMigrations = require.context('./migrations', true, /\\.js$/);\n\nconst migrationModules = reqMigrations.keys().map(key =\u003e reqMigrations(key));\n\nexport default function IDBSuit() {\n  const idbs = new IDBS(Schema, migrationModules);\n  \n  return idbs;\n}\n```\n\nCreate IDBSute object.\n```\nconst idbs = IDBSuit();\n```\n\nOpen connection to your db\n```\n  idbs.openDatabase()\n    .then(dbInstance =\u003e {\n      setDbVersion(dbInstance.version);\n    })\n    .catch(error =\u003e {\n      console.error('Error opening database:', error);\n    });\n```\n\nDestroy db\n\n```\n  idbs.destroy()\n    .then(() =\u003e {\n     console.log('Database deleted successfully');\n    })\n    .catch(error =\u003e {\n      console.error('Error deleting database:', error);\n    });\n```\n\n## Migration\n\nMake sure to always use increamental version number.\nRecommended to use current timestamp integer `new Date().getTime()` as version number.\nSimilarly, you may prefix your migration file with version although it is not neccessary but it may help in visibility.\n\n```\nimport { Migration } from \"idbsuit\";\nexport default class ExampleOne extends Migration{\n  static #_= this.newVersion(1714815400413); // update version number\n  \n  async migrate() {\n    return new Promise((resolve, reject) =\u003e {\n      \n      // Implement your migration logic here\n      \n      resolve();\n    });\n  }\n}\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frahuldhole%2Fidbsuit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frahuldhole%2Fidbsuit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frahuldhole%2Fidbsuit/lists"}