{"id":15394295,"url":"https://github.com/xyproto/simplehstore","last_synced_at":"2025-04-09T21:22:21.698Z","repository":{"id":57482700,"uuid":"49428222","full_name":"xyproto/simplehstore","owner":"xyproto","description":":convenience_store: Easy way to use a PostgreSQL database (and the HSTORE feature) from Go","archived":false,"fork":false,"pushed_at":"2024-12-02T12:30:40.000Z","size":394,"stargazers_count":54,"open_issues_count":1,"forks_count":2,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-02T19:08:26.780Z","etag":null,"topics":["go","hashmap","hstore","key-value","postgresql","postgresql-database","strings"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xyproto.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":"2016-01-11T13:30:04.000Z","updated_at":"2024-12-02T12:30:33.000Z","dependencies_parsed_at":"2024-06-19T00:00:59.682Z","dependency_job_id":"9749aeb3-ee6b-4c7d-aa4f-0be6d3d7fbbe","html_url":"https://github.com/xyproto/simplehstore","commit_stats":{"total_commits":380,"total_committers":6,"mean_commits":"63.333333333333336","dds":"0.050000000000000044","last_synced_commit":"69208ac71169682009e0f76f0798ee593df3c8a4"},"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xyproto%2Fsimplehstore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xyproto%2Fsimplehstore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xyproto%2Fsimplehstore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xyproto%2Fsimplehstore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xyproto","download_url":"https://codeload.github.com/xyproto/simplehstore/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248112742,"owners_count":21049708,"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":["go","hashmap","hstore","key-value","postgresql","postgresql-database","strings"],"created_at":"2024-10-01T15:23:04.096Z","updated_at":"2025-04-09T21:22:21.664Z","avatar_url":"https://github.com/xyproto.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"simplehstore\n===========\n\n[![Build](https://github.com/xyproto/simplehstore/actions/workflows/test.yml/badge.svg)](https://github.com/xyproto/simplehstore/actions/workflows/test.yml)\n[![GoDoc](https://godoc.org/github.com/xyproto/simplehstore?status.svg)](http://godoc.org/github.com/xyproto/simplehstore)\n[![License](http://img.shields.io/badge/license-BSD-blue.svg?style=flat)](https://raw.githubusercontent.com/xyproto/simplehstore/master/LICENSE)\n[![Go Report Card](https://goreportcard.com/badge/github.com/xyproto/simplehstore)](https://goreportcard.com/report/github.com/xyproto/simplehstore)\n\n\nEasy way to use a PostgreSQL database (and the HSTORE feature) from Go.\n\n\nOnline API Documentation\n------------------------\n\n[godoc.org](http://godoc.org/github.com/xyproto/simplehstore)\n\n\nFeatures and limitations\n------------------------\n\n* Requires PostgreSQL 9.1 or later.\n* Requires Go 1.10 or later.\n* Supports simple use of lists, hashmaps, sets and key/values.\n* Deals mainly with strings.\n* Uses the [pq](https://github.com/lib/pq) package.\n* Modeled after [simpleredis](https://github.com/xyproto/simpleredis).\n* Uses SQL queries with HSTORE for the KeyValue and HashMap types.\n* Uses regular SQL for the List and Set types.\n\nSample usage\n------------\n\n~~~go\npackage main\n\nimport (\n    \"log\"\n\n    db \"github.com/xyproto/simplehstore\"\n)\n\nfunc main() {\n    // Check if the local db service is up\n    if err := db.TestConnection(); err != nil {\n        log.Fatalln(\"Could not connect to local database. Is the service up and running?\")\n    }\n\n    // Create a Host, connect to the local db server\n    host := db.New()\n\n    // Connecting to a different host/port\n    //host := db.NewHost(\"server:5432/db\")\n\n    // Connect to a different db host/port, with a username and password\n    // host := db.NewHost(\"username:password@server/db\")\n\n    // Close the connection when the function returns\n    defer host.Close()\n\n    // Create a list named \"greetings\"\n    list, err := db.NewList(host, \"greetings\")\n    if err != nil {\n        log.Fatalln(\"Could not create list!\")\n    }\n\n    // Add \"hello\" to the list, check if there are errors\n    if list.Add(\"hello\") != nil {\n        log.Fatalln(\"Could not add an item to list!\")\n    }\n\n    // Get the last item of the list\n    if item, err := list.GetLast(); err != nil {\n        log.Fatalln(\"Could not fetch the last item from the list!\")\n    } else {\n        log.Println(\"The value of the stored item is:\", item)\n    }\n\n    // Remove the list\n    if list.Remove() != nil {\n        log.Fatalln(\"Could not remove the list!\")\n    }\n}\n~~~\n\nTesting\n-------\n\n* A PostgreSQL server must be up and running locally for `go test` to work, and a database named `test` must exist.\n\n\nLicense, author and version\n---------------------------\n\n* License: BSD-3\n* Author: Alexander F. Rødseth \u0026lt;xyproto@archlinux.org\u0026gt;\n* Version: 1.8.3\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxyproto%2Fsimplehstore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxyproto%2Fsimplehstore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxyproto%2Fsimplehstore/lists"}