1
0
mirror of https://github.com/go-micro/go-micro.git synced 2024-11-24 08:02:32 +02:00

rename postgres to cockroach

This commit is contained in:
Asim Aslam 2019-12-16 15:09:59 +00:00
parent 03700ae6c0
commit 303adca500
2 changed files with 9 additions and 5 deletions

View File

@ -1,9 +1,10 @@
// Package postgresql implements a micro Store backed by sql
package postgresql
// Package cockroach implements the cockroach store
package cockroach
import (
"database/sql"
"fmt"
"strings"
"time"
"unicode"
@ -208,9 +209,12 @@ func New(opts ...store.Option) store.Store {
}
}
source := nodes[0]
if !strings.Contains(source, " ") {
source = fmt.Sprintf("host=%s", source)
}
// create source from first node
source := fmt.Sprintf("host=%s", nodes[0])
db, err := sql.Open("pq", source)
db, err := sql.Open("postgres", source)
if err != nil {
log.Fatal(err)
}

View File

@ -1,4 +1,4 @@
package postgresql
package cockroach
import (
"database/sql"