{"id":31289540,"url":"https://github.com/half0wl/mockgres","last_synced_at":"2025-09-24T14:02:47.788Z","repository":{"id":315472953,"uuid":"1052382063","full_name":"half0wl/mockgres","owner":"half0wl","description":"A simple server implementing basic Postgres protocol for testing purposes.","archived":false,"fork":false,"pushed_at":"2025-09-08T01:26:15.000Z","size":4,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-18T21:40:47.840Z","etag":null,"topics":["postgres","postgresql","testing"],"latest_commit_sha":null,"homepage":"","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/half0wl.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-08T01:04:24.000Z","updated_at":"2025-09-15T01:37:12.000Z","dependencies_parsed_at":"2025-09-18T21:40:49.391Z","dependency_job_id":"57fff073-bcdf-4552-a01f-39aa9a3a67aa","html_url":"https://github.com/half0wl/mockgres","commit_stats":null,"previous_names":["half0wl/mockgres"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/half0wl/mockgres","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/half0wl%2Fmockgres","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/half0wl%2Fmockgres/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/half0wl%2Fmockgres/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/half0wl%2Fmockgres/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/half0wl","download_url":"https://codeload.github.com/half0wl/mockgres/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/half0wl%2Fmockgres/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276761936,"owners_count":25700226,"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-09-24T02:00:09.776Z","response_time":97,"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":["postgres","postgresql","testing"],"created_at":"2025-09-24T14:01:37.269Z","updated_at":"2025-09-24T14:02:47.778Z","avatar_url":"https://github.com/half0wl.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mockgres\n\nA stupidly simple mock Postgres server for testing purposes.\n\n```\n# Run the server:\nPORT=6666 go run ./main.go\nstarting mock server on port 6666\nwaiting for conn on port 6666...\nconn from 127.0.0.1:56372\nstartup message length: 78\nproto: 0x30000\nregular startup message (protocol 3.0)\nstartup parameters: \"user\\x00test\\x00database\\x00foobar\\x00application_name\\x00psql\\x00client_encoding\\x00UTF8\\x00\\x00\"\nuser: test, database: foobar\nrequesting password authentication\nreceived password: \"test\"\nAuthentication successful\nhandshake complete, ready\nconn established\nreceived query: \"select 1;\"\nreceived query: \u003c....\u003e\nhandling \\dt\n\n# From psql:\npsql 'postgresql://test:test@0.0.0.0:6666/foobar?sslmode=disable'\npsql (17.6, server 14.0)\nType \"help\" for help.\n\nfoobar=\u003e select 1;\nSELECT 0\nfoobar=\u003e \\dt\n          List of relations\n Schema |    Name    | Type  | Owner\n--------+------------+-------+-------\n public | test_table | table | test\n(1 row)\n```\n\nThe main use case for this is the `--intentionally-borked` flag which\nsimulates a Postgres server that unexpectedly closes connections with\na TCP RST packet on any query:\n\n```\n# Run server with --intentionally-borked flag:\nPORT=6666 go run ./main.go --intentionally-borked\nstarting mock server on port 6666\n--intentionally-borked is on, will send RST on any query!\n...\nreceived query: \"select 1;\"\nquery recv, sending RST as --intentionally-borked is on\nwaiting 2 seconds before forcing RST close\nforcing RST close on conn!\nquery error: conn forcibly closed with RST\n...\n\n# From psql:\npsql 'postgresql://test:test@0.0.0.0:6666/foobar?sslmode=disable'\npsql (17.6, server 14.0)\nType \"help\" for help.\n\nfoobar=\u003e select 1;\nserver closed the connection unexpectedly\n        This probably means the server terminated abnormally\n        before or while processing the request.\nThe connection to the server was lost. Attempting reset: Failed.\nThe connection to the server was lost. Attempting reset: Failed.\n```\n\nSSL Mode is not supported. You should also be able to connect to this with any\nPostgres client/library.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhalf0wl%2Fmockgres","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhalf0wl%2Fmockgres","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhalf0wl%2Fmockgres/lists"}