my net house

WAHEGURU….!

RUN Timescale after HUGE efforts

My Docker command:

docker run -d --name timescaledbworks -p 5000:5432 -e POSTGRES_PASSWORD=test -e POSTGRES_USER=test -e POSTGRES_DB=test timescale/timescaledb:latest-pg11

my GoLnag Source:

package main

import (
"database/sql"
_ "github.com/lib/pq"
"fmt"

)

func main() {
var err error
// test without port thing
connStr := "user=test dbname=test password=test host=0.0.0.0 sslmode=disable port=5000"
db, err := sql.Open("postgres", connStr)
if err != nil {
fmt.Println("could not connecet to Daatabase")
}
fmt.Println(db)
if err := db.Ping(); err != nil {
fmt.Println("unable to ping DB : " + err.Error())
return
}
//else{
//fmt.Println("able to connecet to db")
//}

//db.Query("CREATE TABLE conditions(time TIMESTAMP NOT NULL,location TEXT NOT NULL,temperature DOUBLE PRECISION NULL,humidity DOUBLE PRECISION NULL);")
//db.Query("CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;")
//db.Query("CREATE TABLE hello")
//db.Query("SELECT create_hypertable('conditions','time','location',4);")
}

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: