Questions tagged [pq]

Pure Go Postgres driver for database/sql

Pure Go Postgres driver for database/sql

81 questions
0
votes
1 answer

Binomial Min-Heap Priority Queue with generic types

I am currently implementing Binomial Min-Heap Priority Queue with generic types. I have given the following binomialminheap.java: class BinomialMinHeap , P> { public static class Entry { private P…
0
votes
1 answer

Go with Postgres: LastInsertedId for non sequential identifiers

I´m writing a small web service in Go which uses Postgres through the pq driver package. I´m using a uuid´s as identifier for my models so LastInsertId won´t work. So I´m thinking I could something like this: var id string res, err :=…
marsrover
  • 715
  • 11
  • 27
-1
votes
1 answer

Proper way to query to check if credentials already exist

I currently have: func foo (w http.ResponseWriter, req *http.Request) { chekr := `SELECT FROM public."Users" WHERE email=$1` err = db.QueryRow(chekr, usr.Email).Scan() if err != sql.ErrNoRows { data, err := json.Marshal("There is…
Nathan Takemori
  • 139
  • 1
  • 10
-1
votes
2 answers

PHP pg_query update statement

I am trying to updata a database table using pq_query in PHP. I have the following code: $q = "UPDATE tableName SET ('data1 = " . $data1 . "', data2='" . $data2 . "') WHERE user=".$user; $success = pg_query($q); if (!$success) { $errormessage…
Alex
  • 49
  • 7
-2
votes
1 answer

lib/pq: Runtime error when querying a database

I'm setting up a PostgreSQL database for my Go backend, but I'm getting this error when trying to read a table: runtime error: invalid memory address or nil pointer dereference /FwzFiles/go/src/runtime/panic.go:82 (0x4423b0) panicmem:…
Fawwaz Yusran
  • 1,260
  • 2
  • 19
  • 36
-4
votes
1 answer

How can I find the problem with Go failed import?

While working on a Go web-app project (for learning), I have encountered the following issue: At the beginning, everything was alright. I imported packages from the standard library, used them in the code and everything worked. up to the moment when…
davidku
  • 39
  • 1
  • 7
1 2 3 4 5
6