{"id":22833105,"url":"https://github.com/lithdew/bun-sqlite-migrator","last_synced_at":"2025-04-23T22:03:55.647Z","repository":{"id":263595341,"uuid":"890892235","full_name":"lithdew/bun-sqlite-migrator","owner":"lithdew","description":"A bun:sqlite port of kysely's migrator module.","archived":false,"fork":false,"pushed_at":"2024-12-02T19:03:27.000Z","size":7,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-23T22:03:49.907Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lithdew.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-11-19T11:12:38.000Z","updated_at":"2025-01-05T22:26:20.000Z","dependencies_parsed_at":"2024-11-19T12:52:20.107Z","dependency_job_id":null,"html_url":"https://github.com/lithdew/bun-sqlite-migrator","commit_stats":null,"previous_names":["lithdew/bun-sqlite-migrator"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lithdew%2Fbun-sqlite-migrator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lithdew%2Fbun-sqlite-migrator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lithdew%2Fbun-sqlite-migrator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lithdew%2Fbun-sqlite-migrator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lithdew","download_url":"https://codeload.github.com/lithdew/bun-sqlite-migrator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250522302,"owners_count":21444511,"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","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":[],"created_at":"2024-12-12T21:11:51.443Z","updated_at":"2025-04-23T22:03:55.496Z","avatar_url":"https://github.com/lithdew.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bun-sqlite-migrator\n\nA bun:sqlite port of [kysely](https://github.com/kysely-org/kysely)'s migrator module.\n\n```ts\nimport { Database } from \"bun:sqlite\";\nimport { Migrator, FileMigrationProvider } from \"bun-sqlite-migrator\";\n\nconst sqlite = new Database(filename, {\n    create: true,\n    readwrite: true,\n    safeIntegers: true,\n    strict: true,\n});\n\nsqlite.exec(\"PRAGMA foreign_keys = ON\");\nsqlite.exec(\"PRAGMA journal_mode = WAL\");\nsqlite.exec(\"PRAGMA synchronous = NORMAL\");\nsqlite.exec(\"PRAGMA temp_store = MEMORY\");\nsqlite.exec(\"PRAGMA cache_size = 10000\");\nsqlite.exec(\"PRAGMA mmap_size = 30000000000\");\n\nconst migrator = new Migrator({\n    db: sqlite,\n    provider: new FileMigrationProvider({\n        migrationFolder: \"./migrations\"\n    }),\n});\n\nconst { error, results } = migrator.migrateToLatest();\n\nfor (const result of results ?? []) {\n    if (result.status === \"Error\") {\n        throw new Error(\n            `failed to execute migration \"${result.migrationName}\"`,\n            { cause: error }\n        );\n    }\n\n    console.log(\n        `migration \"${result.migrationName}\" was executed successfully`\n    );\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flithdew%2Fbun-sqlite-migrator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flithdew%2Fbun-sqlite-migrator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flithdew%2Fbun-sqlite-migrator/lists"}