bokwoon95/go-structured-query

Question: TimeField and sql.NullTime

Closed this issue · 3 comments

Does a TimeField accept an sql.NullTime value on its AssignmentField TimeField.Set ?

It should, TimeField.Set will pass whatever argument it gets (in this case an sql.NullTime) as-is to the underlying database/sql driver. So it's no different from e.g. db.Exec("UPDATE tbl SET field = ?", sql.NullTime{...})

Thanks, that answers my questions.

P.S. any first peeks on sq2? ;) or is it still a very early WIP?

heh, the design of sq2 is still in flux. At any rate it will release after the introduction of generics so that I can implement the ideas in #2. Also I'm adding a new ddl package to sq that generates DDL from the table structs (addressing #1).