pgx is not returning rows after I do an insert

1.4k Views Asked by At

Im just doing an insert using the following code, and while i can see the data in the database, pgx is not returning any rows.

rows, err := db.Query(context.Background(), `
    INSERT INTO 
        reservation (room_id, user_id)
    VALUES 
        ($1, $2)
    `, roomId, userId)

I tried using QueryRow too but same thing, no rows are returned. Can anyone tell me where Im going wrong?

0

There are 0 best solutions below