code: function _setRaw(raw: Object, key: string, value: any, columnSchema: ColumnSchema): void {
    const { type, isOptional } = columnSchema
  
    // If the value is wrong type or invalid, it's set to `null` (if optional) or empty value ('', 0, false)
    if (type === 'string') {
      if (typeof value === 'string') {
        raw[key] = value
      } else {
        raw[key] = isOptional ? null : ''
      }
    } else if (type === 'boolean') {
      if (typeof value === 'boolean') {
        raw[key] = value
      } else if (value === 1 || value === 0) {
        // Exception to the standard rule — because SQLite turns true/false into 1/0
        raw[key] = Boolean(value)
      } else {
        raw[key] = isOptional ? null : false
      }
    } else {
      // type = number
      // Treat NaN and Infinity as null
      if (isValidNumber(value)) {
        raw[key] = value
      } else {
        raw[key] = isOptional ? null : 0
      }
    }
  }
docs: Note: This is performance-critical code