{"repo":"xyproto/simplehstore","free":true,"listed":false,"github":"https://github.com/xyproto/simplehstore","clone":"git clone https://github.com/xyproto/simplehstore.git","description":":convenience_store: Easy way to use a PostgreSQL database (and the HSTORE feature) from Go","language":"Go","stars":55,"topics":["hstore","strings","hashmap","go","key-value","postgresql-database","postgresql"],"license":"BSD-3-Clause","category":"databases-storage","readme_excerpt":"simplehstore =========== Easy way to use a PostgreSQL database (and the HSTORE feature) from Go. Online API Documentation ------------------------ godoc.org Features and limitations ------------------------ Requires PostgreSQL 9.1 or later. Requires Go 1.10 or later. Supports simple use of lists, hashmaps, sets and key/values. Deals mainly with strings. Uses the pq package. Modeled after simpleredis. Uses SQL queries with HSTORE for the KeyValue and HashMap types. Uses regular SQL for the List and Set types. Sample usage ------------ go package main import ( \"log\" db \"github.com/xyproto/simplehstore\" ) func main() { // Check if the local db service is up if err := db.TestConnection(); err != nil { log.Fatalln(\"Could not connect to local database. Is the service up and running?\") } // Create a Host, connect to the local db server host := db.New() // Connecting to a different host/port //host := db.NewHost(\"server:5432/db\") // Connect to a different db host/port, with a username and password // host := db.NewHost(\"username:password@server/db\") // Close the connection when the function returns defer host.Close() // Create a list named \"greetings\" list, err := db.NewList(host, \"greetings\") if err != nil { log.Fatalln(\"Could not create list!\") } // Add \"hello\" to the list, check if there are errors if list.Add(\"hello\") != nil { log.Fatalln(\"Could not add an item to list!\") } // Get the last item of the list if item, err := list.GetLast(); err != nil { log.Fatalln(\"Could not fetch ","default_branch":null,"files":null,"tree":[],"storefront":"/r/xyproto","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/xyproto/simplehstore/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}