{"id":19685405,"url":"https://github.com/kislerdm/neon-sdk-go","last_synced_at":"2025-08-08T04:12:17.763Z","repository":{"id":49875890,"uuid":"517330695","full_name":"kislerdm/neon-sdk-go","owner":"kislerdm","description":"Go SDK to communicate to Neon SaaS platform","archived":false,"fork":false,"pushed_at":"2025-05-05T14:00:11.000Z","size":3744,"stargazers_count":26,"open_issues_count":1,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-07-29T17:44:35.669Z","etag":null,"topics":["go","golang","golang-library","neon","neondatabase","sdk"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/kislerdm/neon-sdk-go","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/kislerdm.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","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,"zenodo":null},"funding":{"github":"kislerdm","custom":["https://paypal.me/DmitryKisler"]}},"created_at":"2022-07-24T13:24:59.000Z","updated_at":"2025-07-25T02:19:34.000Z","dependencies_parsed_at":"2023-10-04T07:51:58.027Z","dependency_job_id":"802eee38-76bf-4c62-8042-c1676e6328c8","html_url":"https://github.com/kislerdm/neon-sdk-go","commit_stats":null,"previous_names":[],"tags_count":35,"template":false,"template_full_name":null,"purl":"pkg:github/kislerdm/neon-sdk-go","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kislerdm%2Fneon-sdk-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kislerdm%2Fneon-sdk-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kislerdm%2Fneon-sdk-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kislerdm%2Fneon-sdk-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kislerdm","download_url":"https://codeload.github.com/kislerdm/neon-sdk-go/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kislerdm%2Fneon-sdk-go/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269361740,"owners_count":24404401,"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-08T02:00:09.200Z","response_time":72,"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":["go","golang","golang-library","neon","neondatabase","sdk"],"created_at":"2024-11-11T18:21:45.780Z","updated_at":"2025-08-08T04:12:17.735Z","avatar_url":"https://github.com/kislerdm.png","language":"Go","funding_links":["https://github.com/sponsors/kislerdm","https://paypal.me/DmitryKisler"],"categories":[],"sub_categories":[],"readme":"# Go SDK for Neon Postgres SaaS Platform\n\n-----\n\n\u003cdiv align=\"center\"\u003e\n    ⭐ The project needs your support! Please leave a star and become a \u003ca href=\"https://github.com/sponsors/kislerdm\"\u003eGitHub sponsor\u003c/a\u003e! ⭐\n\u003c/div\u003e\n\n-----\n\n\u003cdiv align=\"center\"\u003e\n    💖 Thank you \u003ca href=\"https://github.com/neondatabase\"\u003e@neondatabase\u003c/a\u003e for sponsoring the project! 💖\n\u003c/div\u003e\n\n-----\n\n[![logo](fig/logo.png)](https://neon.tech)\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/kislerdm/neon-sdk-go)](https://goreportcard.com/report/github.com/kislerdm/neon-sdk-go)\n[![codecov](https://codecov.io/gh/kislerdm/neon-sdk-go/branch/master/graph/badge.svg?token=F6SF7VX3G3)](https://codecov.io/gh/kislerdm/neon-sdk-go)\n[![Licenses Check](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fkislerdm%2Fneon-sdk-go.svg?type=small)](https://app.fossa.com/reports/fcbd29f3-1d63-4437-9946-cb320a567c42)\n\n- [How to use](#how-to-use)\n    + [Prerequisites](#prerequisites)\n    + [Installation](#installation)\n    + [Code Snippets](#code-snippets)\n        - [Default HTTP Client](#default-http-client)\n        - [Custom HTTP Client](#custom-http-client)\n        - [Mock](#mock)\n    + [End-to-end example](./e2e-example/README.md)\n- [Development](#development)\n    + [Commands](#commands)\n- [Contribution](#contribution)\n\nAn SDK to manage the [Neon Platform](https://neon.tech) programmatically.\n\n\u003e Neon is a serverless Postgres platform designed to help you build reliable and scalable applications faster. Neon\n\u003e separates compute and storage to offer modern developer features such as autoscaling, branching, point-in-time restore,\n\u003e and more. Neon is open source and written in Rust.\n\nFind more about Neon [here](https://neon.tech/docs/introduction/about/).\n\n## How to use\n\n### Prerequisites\n\n- [go ~\u003e 1.18](https://go.dev/dl/)\n- [API Key](https://neon.tech/docs/manage/api-keys/)\n\n### Installation\n\nAdd the SDK as a module dependency:\n\n```commandline\ngo get github.com/kislerdm/neon-sdk-go\n```\n\nRun to specify the release version:\n\n```commandline\ngo get github.com/kislerdm/neon-sdk-go@{{.Ver}}\n```\n\nWhere `{{.Ver}}` is the release version.\n\n### Code Snippets\n\n### Default HTTP Client\n\nThe following snippet demonstrates how to initialize SDK which will use default HTTP client.\n\n```go\npackage main\n\nimport (\n\t\"log\"\n\n\tneon \"github.com/kislerdm/neon-sdk-go\"\n)\n\nfunc main() {\n\tclient, err := neon.NewClient(neon.Config{Key: \"{{.NeonApiKey}}\"})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tv, err := client.ListProjects(nil, nil, nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tlog.Printf(\"%d projects found\", len(v.Projects))\n}\n```\n\n### Custom HTTP client\n\nThe SDK can be initialized with a custom HTTP client.\n\n```go\npackage main\n\nimport (\n\t\"net/http\"\n\t\"log\"\n\t\"time\"\n\n\tneon \"github.com/kislerdm/neon-sdk-go\"\n)\n\nfunc main() {\n\tmyHTTPClient := \u0026http.Client{Timeout: 30 * time.Second}\n\n\tclient, err := neon.NewClient(neon.Config{Key: \"{{.NeonApiKey}}\", HTTPClient: myHTTPClient})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tv, err := client.ListProjects(nil, nil, nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tlog.Printf(\"%d projects found\", len(v.Projects))\n}\n```\n\n#### Mock\n\nThe SDK provides the http client's mock for unit tests. An example snippet is shown below.\n\n```go\npackage main\n\nimport (\n\t\"log\"\n\n\tneon \"github.com/kislerdm/neon-sdk-go\"\n)\n\nfunc main() {\n\tclient, err := neon.NewClient(neon.Config{HTTPClient: neon.NewMockHTTPClient()})\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tv, err := client.ListProjects(nil, nil, nil)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tlog.Printf(\"%d projects found\", len(v.Projects))\n}\n```\n\n## [End-to-end example](./e2e-example/README.md)\n\nFind [here](./e2e-example/README.md) the example of how to use the SDK to create a Neon project and use its default \ndatabase afterward.\n\n## Development\n\nThe SDK codebase is generated using the [OpenAPI](https://spec.openapis.org/) from\nthe [Neon API reference page](https://neon.tech/api-reference/v2/). The generator application codebase can be\nfound [here](generator).\n\n### Commands\n\n**Prerequisites**:\n\n- go ~\u003e 1.22\n- gnuMake / cmake\n\nRun to see all available commands:\n\n```commandline\nmake help\n```\n\nRun to generate the SDK codebase and store it to PWD, given the OpenAPI spec is available in the\nfile [`openAPIDefinition.json`](openAPIDefinition.json):\n\n```commandline\nmake generate-sdk\n```\n\nSet the flag `SKIP_TEST=1` to generate the codebase without running the unit tests afterward:\n\n```commandline\nSKIP_TEST=1 make generate-sdk\n```\n\nRun to customise the locations:\n\n```commandline\nmake generate-sdk PATH_SDK=##/PATH/TO/OUTPUT/SDK/CODE## PATH_SPEC=##/PATH/TO/SPEC.json##\n```\n\nRun to test generated SDK:\n\n```commandline\nmake tests\n```\n\nRun to test generated SDK stored to `/PATH/TO/OUTPUT/SDK/CODE`:\n\n```commandline\nmake tests DIR=/PATH/TO/OUTPUT/SDK/CODE\n```\n\nRun to test the [code generator](generator):\n\n```commandline\nmake tests DIR=generator\n```\n\nRun to build the [code generator](generator):\n\n```commandline\nmake build DIR=generator\n```\n\n## Contribution\n\nThe SDK is distributed under the [MIT license](LICENSE). You can find a full list of dependency\nlicenses [here](https://app.fossa.com/reports/fcbd29f3-1d63-4437-9946-cb320a567c42).\n\nPlease feel free to open an issue ticket or PR to contribute.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkislerdm%2Fneon-sdk-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkislerdm%2Fneon-sdk-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkislerdm%2Fneon-sdk-go/lists"}