4 ms·
Honest question... how is this different from, say: rows, err := db.execute("SELECT col FROM tab WHERE x = ?", 1);
by rckclmbr 13y ago
Honest question... how is this different from, say:
rows, err := db.execute("SELECT col FROM tab WHERE x = ?", 1);
- lann 13y agoPrimarily because you can reuse partial queries and add conditional where clauses more easily. There are other features I haven't shown here as well, like building an IN expression with placeholders from a slice.
- mercurial 13y agoIt's harder to shoot yourself in the foot by mistyping SELECT, for instance, and it's clearly more composable.