func (p Provider) Open(dsn *goukv.DSN) (goukv.Provider, error) {
	driverDSN := fmt.Sprintf("postgres://%s:%s@%s:%s/%s", dsn.Username(), dsn.Password(), dsn.Hostname(), dsn.Port(), dsn.Path())
	db, err := sqlx.Connect("postgres", driverDSN)
	if err != nil {
		return nil, err
	}
	table := dsn.GetString("table")
	if _, err := db.Exec(`
		CREATE EXTENSION IF NOT EXISTS pg_trgm;
		CREATE TABLE IF NOT EXISTS ` + (table) + ` (
			_id SERIAL PRIMARY KEY,
			_k 	VARCHAR,
			_v  TEXT,
			_x  BIGINT DEFAULT 0
		);
		CREATE UNIQUE INDEX IF NOT EXISTS idx_` + (table) + `_k ON ` + (table) + `(_k);
		CREATE INDEX IF NOT EXISTS idx_gintrgm_` + (table) + `_k ON ` + (table) + ` USING GIN(_k gin_trgm_ops);
	`); err != nil {
		return nil, err
	}
	return &Provider{
		db:    db,
		table: table,
	}, nil
}
Open implements goukv.Open
package postgres
import (
	"bytes"
	"database/sql"
	"errors"
	"fmt"
	"strings"
	"time"
	"github.com/alash3al/goukv"
	"github.com/jmoiron/sqlx"
	_ "github.com/lib/pq"
)
type Provider struct {
	db    *sqlx.DB
	table string
}