All Projects → xyproto → simplehstore

xyproto / simplehstore

Licence: BSD-3-Clause license
🏪 Easy way to use a PostgreSQL database (and the HSTORE feature) from Go

Programming Languages

go
31211 projects - #10 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to simplehstore

Hashmap
HashMap JavaScript class for Node.js and the browser. The keys can be anything and won't be stringified
Stars: ✭ 363 (+572.22%)
Mutual labels:  key-value, hashmap
Libft
42 library of basic C functions - queues, lists, memory operations and more 😄
Stars: ✭ 21 (-61.11%)
Mutual labels:  strings
regXwild
⏱ Superfast ^Advanced wildcards++? | Unique algorithms that was implemented on native unmanaged C++ but easily accessible in .NET via Conari (with caching of 0x29 opcodes +optimizations) etc.
Stars: ✭ 20 (-62.96%)
Mutual labels:  strings
hashmap
Faster hash maps in R
Stars: ✭ 72 (+33.33%)
Mutual labels:  hashmap
mock-data
Mock data in PostgreSQL/Greenplum databases
Stars: ✭ 115 (+112.96%)
Mutual labels:  postgresql-database
bigint
bigint is a C++ library which can handle Very very Big Integers. It can calculate factorial of 1000000... it can go any big. It may be useful in Competitive Coding and Scientific Calculations which deals with very very large Integers. It can also be used in Decryption process. It has many inbuilt functions which can be very useful.
Stars: ✭ 34 (-37.04%)
Mutual labels:  strings
kanban-board
Single-click full-stack application (Postgres, Spring Boot & Angular) using Docker Compose
Stars: ✭ 138 (+155.56%)
Mutual labels:  postgresql-database
mySequelWeb
MySequel Web is an open source web based GUI tool to access your MySql database. It is similar to PHP My Admin of WAMP. Here you can access any MySQL database with proper connection strings. We do not save or store any of your connection strings or data. Every thing related to your connection strings are volatile. You can host this as a simple n…
Stars: ✭ 26 (-51.85%)
Mutual labels:  postgresql-database
strings-case
Convert strings between different cases.
Stars: ✭ 65 (+20.37%)
Mutual labels:  strings
Notes
This is a learning note | Java基础,JVM,源码,大数据,面经
Stars: ✭ 69 (+27.78%)
Mutual labels:  hashmap
react-keyevent
An easy-to-use keyboard event react component, Package size less than 3kb
Stars: ✭ 38 (-29.63%)
Mutual labels:  key-value
djprojman
A project management tool in django. Intents to be a simple quick tool for manaing projects, tasks and team, most suitable for small companies.
Stars: ✭ 40 (-25.93%)
Mutual labels:  postgresql-database
trakeva
Transactions, Keys, and Values
Stars: ✭ 24 (-55.56%)
Mutual labels:  key-value
common
Metarhia Common Library
Stars: ✭ 55 (+1.85%)
Mutual labels:  strings
quickmongo
Quick mongodb wrapper for beginners that provides key-value based interface.
Stars: ✭ 73 (+35.19%)
Mutual labels:  key-value
beryldb
BerylDB is a fully modular data structure data manager that can be used to store data as key-value entries. The server allows channel subscription and is optimized to be used as a cache repository. Supported structures include lists, sets, multimaps, and keys.
Stars: ✭ 201 (+272.22%)
Mutual labels:  key-value
keyval-resource
a resource that passes key values between jobs
Stars: ✭ 39 (-27.78%)
Mutual labels:  key-value
rpostgis
rpostgis: R Interface to a 'PostGIS' Database
Stars: ✭ 60 (+11.11%)
Mutual labels:  postgresql-database
KVStore
Swift wrapper over sqlite to store key value pairs in db 🎊🎈
Stars: ✭ 22 (-59.26%)
Mutual labels:  key-value
jsoning
✨ A simple key-value JSON-based persistent lightweight database. ✨
Stars: ✭ 70 (+29.63%)
Mutual labels:  key-value

simplehstore

Build GoDoc License Go Report Card

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

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 the last item from the list!")
    } else {
        log.Println("The value of the stored item is:", item)
    }

    // Remove the list
    if list.Remove() != nil {
        log.Fatalln("Could not remove the list!")
    }
}

Testing

  • A PostgreSQL server must be up and running locally for go test to work, and a database named test must exist.

License, author and version

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].