Sunday, September 8, 2024
HomeGolangLearn how to load embed library with a number of recordsdata -...

Learn how to load embed library with a number of recordsdata – Getting Assist


//go:embed sqls/allquery.sql

I’m utilizing third social gathering library sqload it’s working with single file.

Learn how to implement with a number of recordsdata

Until I’m misunderstanding what you’re asking (as I’m not aware of the sqload library), it’s so simple as embedding a number of recordsdata and utilizing them.

//go:embed sqls/allquery.sql
var allQuery string

//go:embed sqls/someotherquery.sql
var someOtherQuery string

var q1 = sqload.MustLoadFromString[struct {
	...
}](allQuery)

var q2 = sqload.MustLoadFromString[struct {
	...
}](someOtherQuery)

Thank. I used to be attempting by including *.SQL and utilizing single variable

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments