You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Gi. Can I request that the following is added to struct_insert.go
// ToSQL returns a string with the SQL statement (containing placeholders),
// the arguments slices, and an error.
func (si *StructInsert) ToSQL() (string, []interface{}, error) {
a, b, c := si.insertStatement.ToSQL()
return a, b, c
}
The text was updated successfully, but these errors were encountered:
There is no ToSQL function in struct_insert.go, nor struct_select, ... because the purpose of these tools are not to build queries, but to ease structs persistence.
To build queries (either to execute them or just get the SQL code) you can use non-struct insert code : https://github.com/samonzeweb/godb/blob/master/insert_statement.go . There is no reason it does not the job, because stuct insertion use this code under the hood.
Or perhaps there is another thing you want to achieve I didn't see. Let me now if needed.
You can use a logger. All SQL queries are logged, you can dump then to stdout, stderr, a file, ... and as it's optional you can enable/disable the feature as you want/need.
See the README :
// OPTIONAL: Set logger to show SQL execution logs
db.SetLogger(log.New(os.Stderr, "", 0))
Gi. Can I request that the following is added to struct_insert.go
The text was updated successfully, but these errors were encountered: