{"record":{"id":"015a82baed9587ac","repo":"cube-js/cube","slug":"parameter-with-type-object-is-not-supported","errorCode":null,"errorMessage":"Parameter with type: object is not supported","messagePattern":"Parameter with type: object is not supported","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cubejs-cubestore-driver/src/WebSocketConnection.ts","lineNumber":483,"sourceCode":"        HttpParameterValue.NullValue,\n        httpParameterValueOffset\n      );\n    }\n\n    switch (typeof parameter) {\n      case 'object':\n      {\n        if (Buffer.isBuffer(parameter)) {\n          const valueOffset = BinaryValue.createVVector(builder, parameter);\n          const httpParameterValueOffset = BinaryValue.createBinaryValue(builder, valueOffset);\n\n          return HttpParameter.createHttpParameter(\n            builder,\n            HttpParameterValue.BinaryValue,\n            httpParameterValueOffset\n          );\n        } else {\n          throw new Error('Parameter with type: object is not supported');\n        }\n      }\n      case 'boolean':\n      {\n        const httpParameterValueOffset = BoolValue.createBoolValue(\n          builder,\n          parameter\n        );\n\n        return HttpParameter.createHttpParameter(\n          builder,\n          HttpParameterValue.BoolValue,\n          httpParameterValueOffset\n        );\n      }\n      case 'number':\n      {\n        if (Number.isInteger(parameter)) {","sourceCodeStart":465,"sourceCodeEnd":501,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/packages/cubejs-cubestore-driver/src/WebSocketConnection.ts#L465-L501","documentation":"serializeParameter converts JS query parameters into flatbuffer HttpParameter values; plain JS objects are not a representable wire type, so the driver throws. Parameters must be string, number, boolean, or binary.","triggerScenarios":"Passing a JavaScript object (e.g. an array, Date, or nested object) as a query parameter to driver.query() against Cube Store.","commonSituations":"Passing an array for an IN clause instead of expanding placeholders; passing Date objects or JSON blobs unserialized; ORM-built parameter objects.","solutions":["Serialize the object to a JSON string before passing it","Primitives: expand arrays into individual placeholders (?,?,?)","Convert Date to an ISO string","Pre-validate parameter types before calling query()"],"exampleFix":"// before\ndriver.query('SELECT * FROM t WHERE id IN (?)', [[1,2,3]]);\n// after\ndriver.query('SELECT * FROM t WHERE id IN (?, ?, ?)', [1, 2, 3]);","handlingStrategy":"type-guard","validationCode":"function assertSupportedParams(params) {\n  params.forEach((p, i) => {\n    if (Array.isArray(p)) throw new Error(`param ${i}: expand arrays into individual placeholders`);\n    if (p !== null && p !== undefined && typeof p === 'object' && !isBinaryParam(p)) {\n      throw new Error(`param ${i}: serialize object to JSON string first`);\n    }\n  });\n}","typeGuard":"const isSerializableParam = (p) =>\n  ['string', 'number', 'boolean'].includes(typeof p) || p == null || isBinaryParam(p);","tryCatchPattern":"try {\n  return await driver.query(sql, params);\n} catch (e) {\n  if (/Parameter with type: object is not supported/.test(e.message)) {\n    return driver.query(sql, params.map(p =>\n      (p && typeof p === 'object' && !isBinaryParam(p)) ? JSON.stringify(p) : p));\n  }\n  throw e;\n}","preventionTips":["Never pass arrays as a single parameter; expand IN-clause placeholders","Convert Date objects to ISO strings before passing","Wrap complex values with JSON.stringify explicitly","Unit-test query helpers with the actual parameter shapes you send"],"tags":["cubestore","parameters","serialization"],"backgroundTag":"unsupported-parameter-type","analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}