field-detail.js 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. /**
  2. * Column definition packet "Field detail" flag value
  3. * see : https://mariadb.com/kb/en/library/resultset/#field-detail-flag
  4. */
  5. // field cannot be null
  6. module.exports.NOT_NULL = 1;
  7. // field is a primary key
  8. module.exports.PRIMARY_KEY = 2;
  9. //field is unique
  10. module.exports.UNIQUE_KEY = 4;
  11. //field is in a multiple key
  12. module.exports.MULTIPLE_KEY = 8;
  13. //is this field a Blob
  14. module.exports.BLOB = 1 << 4;
  15. // is this field unsigned
  16. module.exports.UNSIGNED = 1 << 5;
  17. //is this field a zerofill
  18. module.exports.ZEROFILL_FLAG = 1 << 6;
  19. //whether this field has a binary collation
  20. module.exports.BINARY_COLLATION = 1 << 7;
  21. //Field is an enumeration
  22. module.exports.ENUM = 1 << 8;
  23. //field auto-increment
  24. module.exports.AUTO_INCREMENT = 1 << 9;
  25. //field is a timestamp value
  26. module.exports.TIMESTAMP = 1 << 10;
  27. //field is a SET
  28. module.exports.SET = 1 << 11;
  29. //field doesn't have default value
  30. module.exports.NO_DEFAULT_VALUE_FLAG = 1 << 12;
  31. //field is set to NOW on UPDATE
  32. module.exports.ON_UPDATE_NOW_FLAG = 1 << 13;
  33. //field is num
  34. module.exports.NUM_FLAG = 1 << 14;