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 cockroach implements the cockroach store
|
||||||
package postgresql
|
package cockroach
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"database/sql"
|
"database/sql"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
"unicode"
|
"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
|
// create source from first node
|
||||||
source := fmt.Sprintf("host=%s", nodes[0])
|
db, err := sql.Open("postgres", source)
|
||||||
db, err := sql.Open("pq", source)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal(err)
|
log.Fatal(err)
|
||||||
}
|
}
|
@ -1,4 +1,4 @@
|
|||||||
package postgresql
|
package cockroach
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"database/sql"
|
"database/sql"
|
Loading…
Reference in New Issue
Block a user