{"id":20533556,"url":"https://github.com/joeychilson/litemigrate","last_synced_at":"2026-04-21T13:33:27.706Z","repository":{"id":151693743,"uuid":"614808750","full_name":"joeychilson/litemigrate","owner":"joeychilson","description":"A simple SQLite migration library for Go.","archived":false,"fork":false,"pushed_at":"2023-03-16T11:25:21.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-06T03:14:20.264Z","etag":null,"topics":["go","golang","migrate","migrations","sql","sqlite"],"latest_commit_sha":null,"homepage":"","language":"Go","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/joeychilson.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":"2023-03-16T11:14:07.000Z","updated_at":"2023-03-16T11:26:55.000Z","dependencies_parsed_at":"2023-06-04T04:30:41.179Z","dependency_job_id":null,"html_url":"https://github.com/joeychilson/litemigrate","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/joeychilson/litemigrate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joeychilson%2Flitemigrate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joeychilson%2Flitemigrate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joeychilson%2Flitemigrate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joeychilson%2Flitemigrate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joeychilson","download_url":"https://codeload.github.com/joeychilson/litemigrate/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joeychilson%2Flitemigrate/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32094550,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-21T11:25:29.218Z","status":"ssl_error","status_checked_at":"2026-04-21T11:25:28.499Z","response_time":128,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["go","golang","migrate","migrations","sql","sqlite"],"created_at":"2024-11-16T00:22:13.553Z","updated_at":"2026-04-21T13:33:27.682Z","avatar_url":"https://github.com/joeychilson.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# litemigrate\n\nA simple SQLite migration library for Go.\n\n## Installation\n\n```bash\ngo get github.com/joeychilson/litemigrate\n```\n\n## Example\n\n```go\npackage main\n\nimport (\n\t\"context\"\n\t\"database/sql\"\n\t\"fmt\"\n\t\"log\"\n\n\t\"github.com/joeychilson/litemigrate\"\n)\n\nfunc main() {\n\tctx := context.Background()\n\n\t// Create the migrations slice.\n\tmigrations := litemigrate.Migrations{\n\t\t{\n\t\t\tVersion:     1,\n\t\t\tDescription: \"create users table\",\n\t\t\tUp: func(tx *sql.Tx) error {\n\t\t\t\t_, err := tx.Exec(`\n\t\t\t\t\tCREATE TABLE IF NOT EXISTS users (\n\t\t\t\t\t\tid INTEGER PRIMARY KEY AUTOINCREMENT,\n\t\t\t\t\t\tname TEXT NOT NULL\n\t\t\t\t\t);\n\t\t\t\t`)\n\t\t\t\treturn err\n\t\t\t},\n\t\t\tDown: func(tx *sql.Tx) error {\n\t\t\t\t_, err := tx.Exec(\"DROP TABLE IF EXISTS users;\")\n\t\t\t\treturn err\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tVersion:     2,\n\t\t\tDescription: \"add email column to users table\",\n\t\t\tUp: func(tx *sql.Tx) error {\n\t\t\t\t_, err := tx.Exec(\"ALTER TABLE users ADD COLUMN email TEXT;\")\n\t\t\t\treturn err\n\t\t\t},\n\t\t\tDown: func(tx *sql.Tx) error {\n\t\t\t\t_, err := tx.Exec(\"ALTER TABLE users DROP COLUMN email;\")\n\t\t\t\treturn err\n\t\t\t},\n\t\t},\n\t}\n\n\t// Create a new database instance.\n\tdb, err := litemigrate.New(\"test.db\", \u0026migrations)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to create database instance: %v\", err)\n\t}\n\n\t// Migrate up to the latest version.\n\terr = db.MigrateUp(ctx)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to migrate up: %v\", err)\n\t}\n\n\t// Migrate down to the previous version.\n\terr = db.MigrateDown(ctx, 1)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to migrate down: %v\", err)\n\t}\n\n\t// Get the current version of the database.\n\tversion, err := db.CurrentVersion(ctx)\n\tif err != nil {\n\t\tlog.Fatalf(\"failed to get current version: %v\", err)\n\t}\n\tfmt.Printf(\"current database version: %d\\n\", version)\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoeychilson%2Flitemigrate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoeychilson%2Flitemigrate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoeychilson%2Flitemigrate/lists"}