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
query:="SELECT * FROM users"// want "avoid SELECT \\* - explicitly specify needed columns for better performance, maintainability and stability"
12
+
13
+
vardb*sql.DB
14
+
rows, _:=db.Query("SELECT * FROM orders WHERE status = ?", "active") // want "avoid SELECT \\* - explicitly specify needed columns for better performance, maintainability and stability"
15
+
_=rows
16
+
17
+
count:="SELECT COUNT(*) FROM users"
18
+
_=count
19
+
20
+
goodQuery:="SELECT id, name, email FROM users"
21
+
_=goodQuery
22
+
23
+
fmt.Println(query)
24
+
25
+
_=strconv.Itoa(42)
26
+
}
27
+
28
+
typeSQLBuilderinterface {
29
+
Select(columns...string) SQLBuilder
30
+
From(tablestring) SQLBuilder
31
+
Where(conditionstring) SQLBuilder
32
+
Query() string
33
+
}
34
+
35
+
func_(builderSQLBuilder) {
36
+
query:=builder.Select("*").From("products") // want "avoid SELECT \\* in SQL builder - explicitly specify columns to prevent unnecessary data transfer and schema change issues"
0 commit comments