All Questions
25
questions
2
votes
1
answer
84
views
Criss Cross Address Deduplication
I have a db table persons in which only persons details are captured. Say Name, Father Name, Email, DOB, Proof of Address, Proof of Identity ,Pincode etc. and I have an address table in which address ...
-1
votes
1
answer
321
views
Invalid Memory Address or Nil Pointer Deference Issue in Gin-Gonic
Revised Question
I am trying to create a new user using Golang. I have a CreateUser() function in my UserImplementation struct which takes a pointer to a User model. The function is responsible for ...
0
votes
1
answer
812
views
ERROR: prepared statement_* doesn't exists
I am 4 days can't resolve my issue and sadly, but chatGPT also weak on this.
In short:
I have Go, Gin-gonic v1.9.0 API which using Gorm ORM v1.24.5 and Postgresql server v14 hosted on the Digitalocean....
1
vote
0
answers
53
views
Why does c.intendedJson not print an array for me while using sql.NullString?
When I use ordinary values, for example, a string, the printout works well for me when executing the GET method through POSTMAN. When I want the values in the database to be NULL, and instead of ...
1
vote
0
answers
302
views
GORM v2 Many to Many does not create new record in join table
Two structs Thread & Interest have a many to many relationship with each other. According to the documentation this is how both structs looks like:
type Thread struct {
ID uuid.UUID `...
1
vote
0
answers
52
views
Merge Lists where a key in each list is the same
I have two tables on a postgreSQL table, products and product_variation. The product_variation contains a foreign key populated by the id which is a primary key for the products table. I am trying to ...
2
votes
0
answers
250
views
Gorm Postgresql got the diff-result when use the same SQL-query
SQL query
with dates as (
select generate_series(
(date ('2022-10-02'))::timestamp,
(date ('2022-10-03'))::timestamp,
interval '...
1
vote
0
answers
369
views
Http2: stream closed occurring again and again
While rendering JSON response from API I am getting "http2: stream closed" error many times while loading that API
I didn't used streaming I am just serving json response using c.JSON() ...
1
vote
0
answers
415
views
How to save a *multipart.FileHeader type to gorm postgres db
am trying to upload an image using the 'content-type: multipart/form-data;
it works but am having troubles saving it to the database using GORM
type Avatar struct{
Image *multipart.FileHeader `...
1
vote
1
answer
10k
views
How to scan jsonb objects from Postgresql to golang structs
Firstly, I've tried solutions from past stackoverflow answers whose questions were related to mine, and nothing has worked, that's why i am asking it as a separate question.
I have two structs in ...
2
votes
0
answers
836
views
GO dynamic update queries with Gin and PGX
I'm trying to build a web service which would receive an HTTP PATCH request to update some fields in a "users" table (so I don't know how many nor which ones have to be updated).
I decided ...
5
votes
2
answers
5k
views
pq: password authentication failed for user "user-name" while accessing postgres in vscode
I am making an API using Golang, and I am using Postgres as database. I have used the following command:-
args := "host=" + host + " port=" + port + " dbName=" + dbName + ...
0
votes
1
answer
2k
views
Gorm Returns Different Timestamp Format Then Used on Record Creation
I'm using GORM to create records from within a Go application that uses gin. I've specified in the gorm.Config file a NowFunc as specified in GORM documentation here.
Here is a full, encapsulated ...
0
votes
0
answers
565
views
Go API on Google App Engine with Postgres
I am trying to connect to my GAE Postgres SQL db using Go+Gin+PGX. I have the Postgres SQL api activated and this program runs on my local machine but does not run on GAE. I think it is not connecting ...
0
votes
2
answers
1k
views
Gorm and Gin error 500 only when Updating
I've a pretty simple CRUD for a Task list, and so far I'm able to Create, List all, List by ID and Delete records, bu when I try to update, it gives me the following error:
go-proj | reflect: ...