You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

nulltime_go113.go 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // Go MySQL Driver - A MySQL-Driver for Go's database/sql package
  2. //
  3. // Copyright 2013 The Go-MySQL-Driver Authors. All rights reserved.
  4. //
  5. // This Source Code Form is subject to the terms of the Mozilla Public
  6. // License, v. 2.0. If a copy of the MPL was not distributed with this file,
  7. // You can obtain one at http://mozilla.org/MPL/2.0/.
  8. // +build go1.13
  9. package mysql
  10. import (
  11. "database/sql"
  12. )
  13. // NullTime represents a time.Time that may be NULL.
  14. // NullTime implements the Scanner interface so
  15. // it can be used as a scan destination:
  16. //
  17. // var nt NullTime
  18. // err := db.QueryRow("SELECT time FROM foo WHERE id=?", id).Scan(&nt)
  19. // ...
  20. // if nt.Valid {
  21. // // use nt.Time
  22. // } else {
  23. // // NULL value
  24. // }
  25. //
  26. // This NullTime implementation is not driver-specific
  27. //
  28. // Deprecated: NullTime doesn't honor the loc DSN parameter.
  29. // NullTime.Scan interprets a time as UTC, not the loc DSN parameter.
  30. // Use sql.NullTime instead.
  31. type NullTime sql.NullTime
  32. // for internal use.
  33. // the mysql package uses sql.NullTime if it is available.
  34. // if not, the package uses mysql.NullTime.
  35. type nullTime = sql.NullTime // sql.NullTime is available