Categorygithub.com/pghq/go-store
modulepackage
1.2.0
Repository: https://github.com/pghq/go-store.git
Documentation: pkg.go.dev

# README

go-store

High-performance persistence library for internal Go apps.

Installation

go-store may be installed using the go get command:

go get github.com/pghq/go-store

Usage

A typical usage scenario:

import (
    "context"
    
    "github.com/pghq/go-store"
)

// Create an instance
db, err := store.New()
if err != nil{
    panic(err)
}

// Add some data
err := db.Do(context.TODO(), func(tx store.Txn) error {
    return tx.Add("tests", map[string]interface{}{"id": "1234"})
})

if err != nil{
    panic(err)
}

# Packages

No description provided by the author
No description provided by the author

# Functions

New creates a new instance of the data store.
NewStore creates a new store instance.
QueryTTL custom duration of time to cache queries for.
WithDSN Use dsn.
WithMigration Use database migration.
WithPg Use custom pg options.

# Structs

BatchConfig configuration for store batch operations.
Config a configuration for the store.
Store an abstraction over database persistence.
Txn A unit of work.

# Type aliases

BatchOption for customizing store batch operations.
Option A store configuration option.