{"id":13536845,"url":"https://github.com/mr-destructive/turso-go","last_synced_at":"2025-07-26T09:32:01.071Z","repository":{"id":203283627,"uuid":"709238475","full_name":"Mr-Destructive/turso-go","owner":"Mr-Destructive","description":"Golang Client for Turso platform API -\u003e turso.tech","archived":false,"fork":false,"pushed_at":"2024-06-19T15:39:42.000Z","size":47,"stargazers_count":15,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-03T01:33:25.866Z","etag":null,"topics":["api-client","turso"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/mr-destructive/turso-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/Mr-Destructive.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":"audit_logs.go","citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-10-24T10:05:08.000Z","updated_at":"2024-10-03T19:32:58.000Z","dependencies_parsed_at":"2023-10-26T15:43:50.163Z","dependency_job_id":"29871d2c-5073-437c-9ef0-f348ca76e6e3","html_url":"https://github.com/Mr-Destructive/turso-go","commit_stats":null,"previous_names":["mr-destructive/turso-go"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mr-Destructive%2Fturso-go","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mr-Destructive%2Fturso-go/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mr-Destructive%2Fturso-go/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Mr-Destructive%2Fturso-go/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Mr-Destructive","download_url":"https://codeload.github.com/Mr-Destructive/turso-go/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227668700,"owners_count":17801514,"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","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":["api-client","turso"],"created_at":"2024-08-01T09:00:50.481Z","updated_at":"2024-12-02T04:13:11.234Z","avatar_url":"https://github.com/Mr-Destructive.png","language":"Go","funding_links":[],"categories":["Tools"],"sub_categories":["Community"],"readme":"## Turso Golang Client\n\nThis is a Golang client for interacting with the Turso API. It provides methods for:\n\n- [x] Managing API tokens\n- [x] Tracking Database Usage\n- [x] Managing Logical DBs and Instances\n\n## Installation\n\n```bash\ngo get github.com/mr-destructive/turso-go\n```\n\n## Usage\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n    \"github.com/mr-destructive/turso-go\"\n)\n\nfunc main() {\n    client := turso.NewClient(\"\", \"YOUR_API_TOKEN\")\n    tokens, err := client.Tokens.List()\n    if err != nil {\n        panic(err)\n    }\n    fmt.Println(tokens)\n}\n```\n\n- Create a new client, first parameter is the Turso API base URL (for the API incase of self hosted), leave empty if using turso.\n- Provide the API token by logging in to the CLI\n\n### Authentication\n\nThe client must be created with a valid API token. Get an API token from the [Turso CLI](https://docs.turso.tech/reference/turso-cli).\n\n- The token will be automatically included in all requests to the API.\n\n### Organizations\n\n- Get all the organisations for the authenticated user:\n\n```go\nclient := turso.NewClient(\"\", \"YOUR_API_TOKEN\")\n\norgs, err := client.Organizations.List()\n\nif err != nil {\n    panic(err)\n}\nfmt.Println(orgs)\n```\n\n- Get members with their roles in a given organisation:\n\n```go\nclient := turso.NewClient(\"\", \"YOUR_API_TOKEN\")\n\n// provide the org slug\nmembers, err := client.Organizations.Members(\"org_slug\")\n\nif err != nil {\n    panic(err)\n}\nfmt.Println(orgs)\n```\n\n#### Databases\n\n- Get all the logical DBs for the organisation:\n\n```go\n// provide the org slug\nlogicalDBs, err := client.Organizations.Databases(\"org_slug\")\nfmt.Println(logicalDBs)\n```\n\n- Get the monthly usage for the database in the organisation:\n\n```go\n// provide the org slug and db name\nusage, err := client.Organizations.DBUsage(\"org_slug\", \"my_db\")\nfmt.Println(usage)\n```\n\n#### Instances\n\n- Get all the instances for the organisation:\n\n```go\n// provide the org slug and db name\ninstances, err := client.Organizations.Instances(\"org_slug\", \"my_db\")\nfmt.Println(instances)\n```\n\n## References\n\n- [Turso Platform REST API docs](https://docs.turso.tech/reference/platform-rest-api/)\n- [Turso CLI](https://docs.turso.tech/reference/turso-cli)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmr-destructive%2Fturso-go","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmr-destructive%2Fturso-go","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmr-destructive%2Fturso-go/lists"}