Skip to content

Using the `dataType` field column option with MySQL

dgsan edited this page Jun 6, 2013 · 2 revisions

The jugglingdb MySQL adapter now supports using the dataType column/property attribute to specify what MySQL column type is used for many jugglingdb types.

Note: this documentation is currently incomplete.

The following type-dataType combinations are supported:

  • Number
    • integer types
      • tinyint
      • smallint
      • mediumint
      • int
      • bigint
      • use the 'limit' option to alter the display width
      • example: { count : { type: Number, dataType: 'smallInt' }}
    • floating point types
      • float
      • double
      • use the precision and scale options to specify custom precision. Default is (16,8).
      • example: { average : { type: Number, dataType: 'float', precision: 20, scale: 4 }}
    • fixed-point exact value types
      • decimal
      • numeric
      • use the precision and scale options to specify custom precision. Default is (9,2).
      • these aren't likely to function as true fixed-point.
      • example: { stdDev : { type: Number, dataType: 'decimal', precision: 12, scale: 8 }}
  • String / Schema.Text / Schema.JSON
    • varchar
    • char
    • text
    • mediumtext
    • tinytext
    • longtext
  • Date
    • datetime
    • timestamp
Clone this wiki locally