{"id":20679646,"url":"https://github.com/petrkotek/gkv","last_synced_at":"2026-04-17T23:36:43.131Z","repository":{"id":149328200,"uuid":"44785771","full_name":"petrkotek/gkv","owner":"petrkotek","description":"Extremely simple Key/Value store for Go (golang) with MySQL backend.","archived":false,"fork":false,"pushed_at":"2015-11-05T01:28:10.000Z","size":184,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-10T19:37:57.092Z","etag":null,"topics":["golang","keyvalue","keyvaluestore","mysql"],"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/petrkotek.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}},"created_at":"2015-10-23T02:23:22.000Z","updated_at":"2023-01-02T20:15:15.000Z","dependencies_parsed_at":"2023-04-12T02:40:55.681Z","dependency_job_id":null,"html_url":"https://github.com/petrkotek/gkv","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/petrkotek/gkv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petrkotek%2Fgkv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petrkotek%2Fgkv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petrkotek%2Fgkv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petrkotek%2Fgkv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/petrkotek","download_url":"https://codeload.github.com/petrkotek/gkv/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/petrkotek%2Fgkv/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31950749,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T17:29:20.459Z","status":"ssl_error","status_checked_at":"2026-04-17T17:28:47.801Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["golang","keyvalue","keyvaluestore","mysql"],"created_at":"2024-11-16T21:26:48.635Z","updated_at":"2026-04-17T23:36:43.088Z","avatar_url":"https://github.com/petrkotek.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/petrkotek/gkv.svg?branch=master)](https://travis-ci.org/petrkotek/gkv)\n[![Coverage Status](https://coveralls.io/repos/petrkotek/gkv/badge.svg?branch=master\u0026service=github)](https://coveralls.io/github/petrkotek/gkv?branch=master)\n\n# gkv\nExtremely simple Key/Value store for Go (golang).\n\nCurrently comes with only one backend implementation - MySQL. `gkv` doesn't support transactions or other fancy features.\n\nThe only methods it supports are `Set(key, value)`, `Get(key)` and `Delete(key)`, where both `key` and `value` are strings. \n \n## Example Usage\n#### 1. Create database table on your MySQL server, e.g.:\n```sql\nCREATE TABLE `key_value_store`\n  `key` VARBINARY(32) PRIMARY KEY,\n  `value` VARBINARY(128) NOT NULL\n)\n```\n\n#### 2. Import `gkv` in your `.go` file:\n```go\nimport \"github.com/petrkotek/gkv\"\n```\n\n#### 3. Use `gkv`!\n```go\ndb, err := sql.Open(\"mysql\", \"user:pwd@tcp(localhost:3306)/test_db\")\nif err != nil {\n    // TODO: handle error\n}\n\nkv, err := gkv.NewMySQLKeyValueStore(db, \u0026gkv.SQLKeyValueStoreConfig{\n    TableName:   \"key_value_store\",\n    KeyColumn:   \"key\",\n    ValueColumn: \"value\",\n    MaxKeyLen:   32,\n    MaxValueLen: 128,\n})\nif err != nil {\n    // TODO: handle error\n}\n\n// set a value for the key\nerr = kv.Set(\"foo\", \"bar\")\nif err != nil {\n    // TODO: handle error\n}\n\n// retrieve the value\nvalue, err := kv.Get(\"foo\")\nif err != nil {\n    // TODO: handle error\n}\nfmt.Print(value)\n\n// delete the key\nerr = kv.Del(\"foo\")\nif err != nil {\n    // TODO: handle error\n}\n\nkv.Close()\n```\n\n## Other Key/Value Stores for Go\nThis project is useful only for limited number of use cases (such as when you already have MySQL database/cluster running and don't want to use proper Key-Value database).\n \nIn many cases, safer choice will be using for instance one of these packages, which purely use Go and file-backed storage:\n\n* [boltdb/bolt](https://github.com/boltdb/bolt)\n* [steveyen/gkvlite](https://github.com/steveyen/gkvlite)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpetrkotek%2Fgkv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpetrkotek%2Fgkv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpetrkotek%2Fgkv/lists"}