-
Notifications
You must be signed in to change notification settings - Fork 0
Datatype
Masanobu Shimura edited this page Apr 8, 2015
·
3 revisions
outside SQLのpmbのパラメータは、下記のDatatypeのみ使用可能です。
string, df.NullString (sql.NullStringも使用出来ますが自動作成はdf.NullStringになります。sqlserverで outside sql自動作成時にdate型が NullStringと判定されるJava Driverのエラー回避のため)
int64, sql.NullInt64, float64, sql.Float64 df.Numeric, df.NullNumeric (Numericについてリンク)
bool, sql.NullBool
time.Time, pq.NullTime, df.Date, df.NullDate, df.Timestamp, df.NullTimestamp
なおMysqlの場合は下記使用
df.MysqlTime, df.MysqlNullTime, df.MysqlDate, df.MysqlNullDate, df.MysqlTimestamp, df.MysqlNullTImestamp
[]byte
Null対応型は ValidというFieldを持っていて、これが falseの場合は、nullを表します。
また引数設定時、いちいちnew()にて作成し、Valid=trueおよび値の設定をするのは面倒ですので、 df.Xxxxxにて 作成するHelper Methodを用意してあります。(Null以外も日付・時刻型には用意)