Another problem is that INSERT is not a query. Use QueryContext for SELECT
statements, and ExecContext for everything else.
muhorto...@gmail.com a következőt írta (2021. október 2., szombat, 12:52:44
UTC+2):
> Just started making my first web, I don't quite understand the Query Row
> function.
Then there are two other problems with your code snippet.
You return an error but have no function return parameter declared, so
this code would not even compile as is.
The second problem is that you call QueryRow with an sql insert
statement that does not returns anything unless you add a retur
Hi Денис,
QueryRow does not return an error but a Row that you then call Scan on
which returns an error.
https://pkg.go.dev/github.com/jackc/pgx/v4#Conn.QueryRow
You usually call it in combination with scan.
err := QueryRow(`…`).Scan(&dest)
Have fun!
On 10/2/21 12:52 PM, Денис Мухортов wrot
If you want to know what the error is, I suggest you print it. That will
give you more information. It will also help anyone trying to help you.
Also, I notice that you *probably *have
"defer conn.Close(context.Background())" in the wrong place.* I don't use
pgx*, but the normal paradigm is to
Just started making my first web, I don't quite understand the Query Row
function. An error is returned, I process it. What is the error?
func save(w http.ResponseWriter, r *http.Request) {
login := r.FormValue("login")
password := r.FormValue("password")
if login == "" || password ==
Never mind, waiting fixed it. The package showed up around 40 minutes
after I published it on github.
All the best,
Jochen
On Saturday, 2 October 2021 at 11:11:23 UTC+1 Jochen Voss wrote:
> Hello,
>
> I have just published a new version of my websocket library, but I cannot
> get it to load i
Hello,
I have just published a new version of my websocket library, but I cannot
get it to load into the client. The error message is as follows:
> go get seehuhn.de/go/websocket@v1.1.0
go: downloading seehuhn.de/go/websocket v1.1.0
go get: seehuhn.de/go/websocket@v1.1.0: verifying