updates
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
// ## Postgres
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
_ "github.com/bmizerany/pq"
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"time"
|
||||
)
|
||||
import _ "github.com/bmizerany/pq"
|
||||
import "database/sql"
|
||||
import "time"
|
||||
import "fmt"
|
||||
|
||||
func main() {
|
||||
db, openErr := sql.Open("postgres", "dbname=gobyexample sslmode=disable")
|
||||
@@ -50,16 +50,7 @@ func main() {
|
||||
fmt.Println(dropRep)
|
||||
}
|
||||
|
||||
// == running
|
||||
// # start postgres
|
||||
// $ createdb gobyexample
|
||||
// $ cd xx-postgres
|
||||
// $ go get
|
||||
// $ ./xx-postgres
|
||||
|
||||
// == todo
|
||||
// connection pooling
|
||||
// concurrency
|
||||
// re-connection
|
||||
// errors
|
||||
// explain
|
||||
// todo: connection pooling & concurrency
|
||||
// todo: re-connection
|
||||
// todo: errors
|
||||
// todo: database_url
|
||||
10
076-postgres/postgres.sh
Normal file
10
076-postgres/postgres.sh
Normal file
@@ -0,0 +1,10 @@
|
||||
# First, be sure that you've installed Postgres
|
||||
# and have a server running locally at port 5432.
|
||||
|
||||
# Then create an example database.
|
||||
$ createdb gobyexample
|
||||
|
||||
# Now install the dependencies for the postgres
|
||||
# example and try running it.
|
||||
$ go get github.com/bmizerany/pq
|
||||
$ go run postgres.go
|
||||
Reference in New Issue
Block a user