{"id":18555804,"url":"https://github.com/infinitybotlist/hepatitis-antiviral","last_synced_at":"2025-08-02T09:38:59.135Z","repository":{"id":37770648,"uuid":"505019212","full_name":"InfinityBotList/hepatitis-antiviral","owner":"InfinityBotList","description":"Simple Tool to Migrate Mongo Data to Postgres","archived":false,"fork":false,"pushed_at":"2023-02-20T10:52:27.000Z","size":13158,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-15T13:11:20.459Z","etag":null,"topics":[],"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/InfinityBotList.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":"2022-06-19T05:21:19.000Z","updated_at":"2023-08-26T16:49:36.000Z","dependencies_parsed_at":"2024-11-06T21:33:30.814Z","dependency_job_id":"74124697-d1fd-4ad5-a626-be5f435e6304","html_url":"https://github.com/InfinityBotList/hepatitis-antiviral","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/InfinityBotList/hepatitis-antiviral","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InfinityBotList%2Fhepatitis-antiviral","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InfinityBotList%2Fhepatitis-antiviral/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InfinityBotList%2Fhepatitis-antiviral/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InfinityBotList%2Fhepatitis-antiviral/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/InfinityBotList","download_url":"https://codeload.github.com/InfinityBotList/hepatitis-antiviral/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/InfinityBotList%2Fhepatitis-antiviral/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268363045,"owners_count":24238550,"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-08-02T02:00:12.353Z","response_time":74,"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-06T21:27:56.378Z","updated_at":"2025-08-02T09:38:59.073Z","avatar_url":"https://github.com/InfinityBotList.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch2 align='center'\u003e\n  \u003cimg src=\"https://cdn.infinitybots.xyz/images/png/Infinity5.png\" height='100px' width='100px' /\u003e\n  \u003cbr\u003e \n  Calypso\n\u003c/h2\u003e\n\u003cp align=\"center\"\u003e\n Simple Tool for Migrating Data From Any Database to Postgres\n\u003c/p\u003e\n\n\u003chr\u003e\n\n## You should be able to rawly plugin your Go structs to this tool\n\nThe ``src`` and ``dest`` struct tags define the db column name source and destination\n\nA primary key of ``itag`` is created to identify each row uniquely.\n\nPlace all structs to backup in ``schemas.go`` and then add them to ``backupSchemas`` function. Remove existing schemas if present.\n\n### Extra options \n\nThese extra options are placed in struct tags in your schema\n\n- ``mark`` -\u003e Marks a custom datatype to use\n- ``default`` -\u003e Sets a default when in doubt. A default value of ``SKIP`` skips the whole row when it is encountered.\n- ``log`` -\u003e Whether to log or not\n- ``unique`` -\u003e Whether or not a unique constaint should be set (``true`` or default ``false``)\n- ``notnull`` -\u003e Force not null to be set\n- ``fkey`` -\u003e The foreign key to set. Format is ``parent table name,column name``\n- ``omit`` -\u003e Whether or not to omit this field, a default value will be used in this case\n\nFor more advanced options, you can use a transform function. This function is called on each data entry and can be used to modify the data before it is inserted into the database. The function is defined in ``transform.go`` and is called in ``backupSchemas`` function.\n\n### Daemon\n\nFor the purposes of logging and asking for user input while migrating, a foreground ``daemon`` is required/used. The daemon is written in python. Run ``cd daemon \u0026\u0026 python3 daemon.py`` to start it.\n\n### Usage\n\n1. Add your schemas and export functions (if you need custom code to be run before (``pre``) or as a default (``defaultfunc``))\n\n**Example:**\n\n```go\n        UserID                    string         `bson:\"userID\" json:\"user_id\" unique:\"true\" default:\"SKIP\" pre:\"usertrim\"`\n        Username                  string         `bson:\"username\" json:\"username\" defaultfunc:\"getuser\" default:\"User\"`\nPackVotes                 map[string]any `bson:\"pack_votes\" json:\"pack_votes\" default:\"{}\"`\n```\n2. If you wish to add any migrations, add them to ``migrations/miglist.go``\n3. Do ``go build`` to build the tool\n4. Run ``hepatitis-antiviral`` \n\n## Sources\n\nSome db sources are implemented by default:\n\n- ``mongo`` -\u003e MongoDB\n- ``jsonfile`` -\u003e JSON File\n\n``postgres`` as a data source is only implemented as a ``backup`` source at this time. This means it can only be used with the WIP backup feature (seperate from the main features of this tool).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finfinitybotlist%2Fhepatitis-antiviral","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finfinitybotlist%2Fhepatitis-antiviral","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finfinitybotlist%2Fhepatitis-antiviral/lists"}