{"id":21650901,"url":"https://github.com/iansinnott/sqlite-syncta","last_synced_at":"2026-05-11T04:56:52.895Z","repository":{"id":66111858,"uuid":"576975284","full_name":"iansinnott/sqlite-syncta","owner":"iansinnott","description":"Experimenting with syncing sqlite databases","archived":false,"fork":false,"pushed_at":"2022-12-11T15:39:16.000Z","size":9,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-09T21:43:09.850Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/iansinnott.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":"2022-12-11T15:39:00.000Z","updated_at":"2023-03-10T10:19:08.000Z","dependencies_parsed_at":"2023-03-05T15:30:45.933Z","dependency_job_id":null,"html_url":"https://github.com/iansinnott/sqlite-syncta","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/iansinnott/sqlite-syncta","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iansinnott%2Fsqlite-syncta","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iansinnott%2Fsqlite-syncta/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iansinnott%2Fsqlite-syncta/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iansinnott%2Fsqlite-syncta/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/iansinnott","download_url":"https://codeload.github.com/iansinnott/sqlite-syncta/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/iansinnott%2Fsqlite-syncta/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32882110,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-10T13:40:02.631Z","status":"online","status_checked_at":"2026-05-11T02:00:05.975Z","response_time":120,"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":[],"created_at":"2024-11-25T07:45:53.521Z","updated_at":"2026-05-11T04:56:52.879Z","avatar_url":"https://github.com/iansinnott.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Syncta: Sync sqlite databases\n\n**Status:** Unfinished experiment.\n\n## Context\n\nThis was an experiment in what would be required to sync to databases\nin a semi-general sense. Meaning that you know something about the data\nstructure or could modify it somewhat in order to achieve the desired sync\nresults.\n\nHowever, I had no need for this at the time. It was simply out of curiosity. As\nsuch, it remains unfinished.\n\nInitial thinking:\n\n- For each row, of each table, copy from `src` to `dest`\n- In the case of conflict, use a last-write-wins strategy to chose between the\n  two rows\n\nProblems:\n\n- How do we know when the last write of a specific row was? Without a cell to\n  track an updated timestamp we don't know. Even with a timestamp if it was\n  created on different machines (i.e. syncing a database from a remote host) we\n  don't have any guarantees the timestamps would match up.\n  - one could add `updated_at` fields to everything. indeed this was my initial\n    thought, but it's so inelegant. If you have a many-to-many join table it\n    feels awkward to add an `updated_at` field to each edge that would otherwise\n    just be two foreign key fields.\n- What if migrations are not up to date on both databases? Just assume they are.\n  This is not a migration tool.\n\nLearnings:\n\n- Hadn't played around with Sqlite introspection prior to this\n  - Most notably `PRAGMA table_info(table_name)`\n  - Check out the `TableInfo` struct for what is extracted\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiansinnott%2Fsqlite-syncta","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiansinnott%2Fsqlite-syncta","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiansinnott%2Fsqlite-syncta/lists"}