Need help in inserting the data into a table from a Struct which is similar to that of a table.
I doesn’t want to write long insert script something like this
insert into <table_name> values (?,?,?,?..)
and passing values from each item in struct.
ORM is one way to go. I do not like it, because of all the magic creates limitations and you have to learn a new “language” supported by a smaller group. Getting help with plain SQL questions is easier than getting help with an ORM question.
That said, I do not like to write code that seems to be repeated either. So I use sqlx with .StructScan. Inserts is still boring though.