{"id":"e4417dbe29c2fa11","repo":"drizzle-team/drizzle-orm","slug":"failed-query-query-params-params","errorCode":null,"errorMessage":"Failed query: ${query}\nparams: ${params}","messagePattern":"Failed query: (.+?)\nparams: (.+?)","errorType":"exception","errorClass":"DrizzleQueryError","httpStatus":null,"severity":"error","filePath":"drizzle-orm/src/gel-core/session.ts","lineNumber":51,"sourceCode":"\t\tif (cache && cache.strategy() === 'all' && cacheConfig === undefined) {\n\t\t\tthis.cacheConfig = { enable: true, autoInvalidate: true };\n\t\t}\n\t\tif (!this.cacheConfig?.enable) {\n\t\t\tthis.cacheConfig = undefined;\n\t\t}\n\t}\n\n\t/** @internal */\n\tprotected async queryWithCache<T>(\n\t\tqueryString: string,\n\t\tparams: any[],\n\t\tquery: () => Promise<T>,\n\t): Promise<T> {\n\t\tif (this.cache === undefined || is(this.cache, NoopCache) || this.queryMetadata === undefined) {\n\t\t\ttry {\n\t\t\t\treturn await query();\n\t\t\t} catch (e) {\n\t\t\t\tthrow new DrizzleQueryError(queryString, params, e as Error);\n\t\t\t}\n\t\t}\n\n\t\t// don't do any mutations, if globally is false\n\t\tif (this.cacheConfig && !this.cacheConfig.enable) {\n\t\t\ttry {\n\t\t\t\treturn await query();\n\t\t\t} catch (e) {\n\t\t\t\tthrow new DrizzleQueryError(queryString, params, e as Error);\n\t\t\t}\n\t\t}\n\n\t\t// For mutate queries, we should query the database, wait for a response, and then perform invalidation\n\t\tif (\n\t\t\t(\n\t\t\t\tthis.queryMetadata.type === 'insert' || this.queryMetadata.type === 'update'\n\t\t\t\t|| this.queryMetadata.type === 'delete'\n\t\t\t) && this.queryMetadata.tables.length > 0","sourceCodeStart":33,"sourceCodeEnd":69,"githubUrl":"https://github.com/drizzle-team/drizzle-orm/blob/b7862528fd8fc39bc2653a6c18dad7c1f4e68d10/drizzle-orm/src/gel-core/session.ts#L33-L69","documentation":"Error \"Failed query: ${query}\nparams: ${params}\" thrown in drizzle-team/drizzle-orm.","triggerScenarios":"Any Gel query execution that the database rejects; Drizzle wraps the driver error with the failing query and params.","commonSituations":"Syntax errors, constraint violations, missing tables/columns, or type mismatches surfaced through the Gel session.","solutions":["Inspect the logged query and params to find the underlying database error (syntax, constraint violation, connection issue).","Validate parameter types match the column types expected by the query.","Wrap the call in try/catch and surface the original driver error cause for details."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"b7862528fd8fc39bc2653a6c18dad7c1f4e68d10","analyzedAt":"2026-08-03T18:11:14.318Z","schemaVersion":2}