Categorygithub.com/appliedres/cloudy-pg
repositorypackage
0.0.14
Repository: https://github.com/appliedres/cloudy-pg.git
Documentation: pkg.go.dev

# README

cloudy-pg

Postgresql implementation of Cloudy providers

Example

go get "github.com/cloudy-pg"

package main

import (
    "github.com/cloudy-pg"
    "github.com/cloudy"
)

func main() {
    ctx := cloudy.StartContext()

    localPG := "postgres://postgres:admin@localhost:5432/postgres"
    pgConfig := &PostgreSqlConfig{
        Connection: localPG,
        Database:   "sample",
        Table:      "sample",
    }

	ds := NewPostgreSqlJsonDataStore[tests.TestItem](ctx, pgConfig)

    testDoc := &TestItem{
		ID:   "12345",
		Name: "TEST",
	}

    fmt.Println("Saving")
	err := ds.Save(ctx, testDoc, testDoc.ID)
}