How to execute an INSERT query using sqlx for a data which has embedded struct?

This page summarizes the projects mentioned and recommended in the original post on reddit.com/r/golang

Our great sponsors
  • OPS - Build and Run Open Source Unikernels
  • SonarLint - Deliver Cleaner and Safer Code - Right in Your IDE of Choice!
  • Scout APM - Less time debugging, more time building
  • GitHub repo sqlx

    general purpose extensions to golang's database/sql

    Say we want to insert the following data using INSERT query to a mysql database - say SampleDatabase (using sqlx - https://github.com/jmoiron/sqlx) type Sample struct { A int64 B string Data interface{} } Data can be type C struct{} or type D struct{} or nil type C struct{} and type D struct{} have fields defined within them like type C struct{ E int64 F string }

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts