rename postgres to cockroach
This commit is contained in:
parent
03700ae6c0
commit
303adca500
@ -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)
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package postgresql
|
||||
package cockroach
|
||||
|
||||
import (
|
||||
"database/sql"
|
Loading…
x
Reference in New Issue
Block a user