{"id":34867148,"url":"https://github.com/artem78/lazdatabaseversioning","last_synced_at":"2026-05-23T00:02:20.608Z","repository":{"id":40473554,"uuid":"495891808","full_name":"artem78/LazDatabaseVersioning","owner":"artem78","description":"Lazarus database versioning unit","archived":false,"fork":false,"pushed_at":"2024-12-05T18:52:22.000Z","size":204,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-27T07:21:10.144Z","etag":null,"topics":["database","database-management","database-migrations","freepascal","version-control","versioning"],"latest_commit_sha":null,"homepage":"","language":"Pascal","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/artem78.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2022-05-24T15:54:38.000Z","updated_at":"2024-12-05T18:52:26.000Z","dependencies_parsed_at":"2024-12-05T19:39:11.980Z","dependency_job_id":null,"html_url":"https://github.com/artem78/LazDatabaseVersioning","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/artem78/LazDatabaseVersioning","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artem78%2FLazDatabaseVersioning","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artem78%2FLazDatabaseVersioning/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artem78%2FLazDatabaseVersioning/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artem78%2FLazDatabaseVersioning/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/artem78","download_url":"https://codeload.github.com/artem78/LazDatabaseVersioning/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/artem78%2FLazDatabaseVersioning/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33377358,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-22T21:56:13.512Z","status":"ssl_error","status_checked_at":"2026-05-22T21:56:10.769Z","response_time":265,"last_error":"SSL_read: 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","database-management","database-migrations","freepascal","version-control","versioning"],"created_at":"2025-12-25T22:39:15.238Z","updated_at":"2026-05-23T00:02:20.601Z","avatar_url":"https://github.com/artem78.png","language":"Pascal","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LazDatabaseVersioning\n\nThis will help you to auto upgrade database scheme.\n\n## Limitations\n\n- Works with SQLite and MySQL only (not tested with other databases)\n\n## Quickstart\n\nCreate `db-upgrades` directory in your application folder and place SQL scripts named `1.sql`, `2.sql` and etc. into it.\n\nTypicaly usage:\n\n```pascal\nuses\n  ..., DatabaseVersioning, ...;\n\n\n\nprocedure TMainForm.FormCreate(Sender: TObject);\nvar\n  DBVer: TDBVersioning;\nbegin\n  SQLite3Connection1.Open;\n\n  DBVer := TDBVersioning.Create(SQLite3Connection1, SQLTransaction1);\n  if DBVer.CurrentVersion \u003e DBVer.LatestVersion then\n  begin\n    MessageDlg('Seems you use database file made with more recent version of application!', mtError, [mbOK], 0);\n    Application.Terminate;\n  end\n  else if DBVer.UpgradeNeeded then\n  begin\n    try\n      // Upgrade database schema\n      DBVer.UpgradeToLatest;\n    except\n      on E: Exception do\n      begin\n        MessageDlg('db upgrade failed!' + sLineBreak + E.ToString, mtError, [mbOK], 0);\n        Application.Terminate;\n      end;\n    end;\n  end;\n  DBVer.Free;\n\n  // SQLQueries should be activated after their tables created on previous step\n  ContactsSQLQuery.Open;\n  GroupsSQLQuery.Open;\nend;  \n```\n\n## How to use and examples\n\n*coming soon...*\n\nSee [test cases](/Tests/testcase1.pas).\n\n## Documentation\n\nGo to https://artem78.github.io/LazDatabaseVersioning/\n\n## ToDos\n- [ ] Write description and usage instructions\n- [x] Allow to place SQL commands in code in addition to use separate files\n- [x] Use transactions for each db upgrade, check if upgrade finished succesfully\n- [ ] Rollback upgrades (downgrade DB)\n- [ ] Use docker container with mysql for testing\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartem78%2Flazdatabaseversioning","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fartem78%2Flazdatabaseversioning","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fartem78%2Flazdatabaseversioning/lists"}