{"record":{"id":"7a5cafe5384fafef","repo":"can1357/oh-my-pi","slug":"unsupported-sqlite-query-parameter-keyname","errorCode":null,"errorMessage":"Unsupported SQLite query parameter '${keyName}'","messagePattern":"Unsupported SQLite query parameter '(.+?)'","errorType":"validation","errorClass":"ToolError","httpStatus":null,"severity":"error","filePath":"packages/coding-agent/src/tools/sqlite-reader.ts","lineNumber":605,"sourceCode":"\tif (!table) {\n\t\tthrow new ToolError(\"SQLite selectors must include a table name\");\n\t}\n\n\tif (key !== undefined && key.length > 0) {\n\t\tif (params.size > 0) {\n\t\t\tthrow new ToolError(\"SQLite row lookups cannot be combined with query parameters\");\n\t\t}\n\t\treturn { kind: \"row\", table, key };\n\t}\n\n\tconst where = validateWhereClause(params.get(\"where\") ?? undefined);\n\tconst order = params.get(\"order\")?.trim() || undefined;\n\tconst hasQueryParams = params.has(\"limit\") || params.has(\"offset\") || order !== undefined || where !== undefined;\n\tif (hasQueryParams) {\n\t\tconst knownKeys = new Set([\"limit\", \"offset\", \"order\", \"where\"]);\n\t\tfor (const keyName of params.keys()) {\n\t\t\tif (!knownKeys.has(keyName)) {\n\t\t\t\tthrow new ToolError(`Unsupported SQLite query parameter '${keyName}'`);\n\t\t\t}\n\t\t}\n\t\treturn {\n\t\t\tkind: \"query\",\n\t\t\ttable,\n\t\t\tlimit: parseLimit(params.get(\"limit\"), DEFAULT_QUERY_LIMIT),\n\t\t\toffset: parseOffset(params.get(\"offset\")),\n\t\t\torder,\n\t\t\twhere,\n\t\t};\n\t}\n\n\tif (params.size > 0) {\n\t\tfor (const keyName of params.keys()) {\n\t\t\tthrow new ToolError(`Unsupported SQLite query parameter '${keyName}'`);\n\t\t}\n\t}\n","sourceCodeStart":587,"sourceCodeEnd":623,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/coding-agent/src/tools/sqlite-reader.ts#L587-L623","documentation":"The sqlite-reader tool builds a paginated table query from URL query parameters (limit, offset, order, where) on a `db.sqlite/table` selector. When any pagination parameter is present, every supplied parameter must be one of the four known keys; an unknown key means the selector string was likely mistyped or mis-encoded, so the tool throws a ToolError instead of silently ignoring it.","triggerScenarios":"Calling parseSqliteSelector (via a sqlite:// resource like `db.sqlite:table?limit=5&foo=bar`) where at least one of limit/offset/order/where is present AND an unrecognized key such as `sort`, `filter`, `page`, or `fields` also appears in the query string.","commonSituations":"Developer guesses at parameter names (`sort=` instead of `order=`, `filter=` instead of `where=`); URL fragments or extra params from copy-paste; a template adds tracking-style params; case sensitivity (`Limit=` is not `limit=`).","solutions":["Replace the unknown parameter with a supported one: limit, offset, order, or where","If filtering by column values, use ?where=<sql condition> instead of filter-like params","If you need arbitrary SQL, use the raw query selector `db.sqlite?q=SELECT ...` instead of table params","Check the query string for stray characters, typos, or duplicated parameters (URLSearchParams will surface both keys)"],"exampleFix":"// before\nsqlite://app.db?users?sort=name&limit=10\n// after\nsqlite://app.db?users?order=name&limit=10","handlingStrategy":"validation","validationCode":"const ALLOWED = new Set([\"limit\", \"offset\", \"order\", \"where\"]);\nconst params = new URLSearchParams(queryString);\nconst bad = [...params.keys()].filter(k => !ALLOWED.has(k));\nif (bad.length) throw new Error(`Unsupported SQLite query parameter(s): ${bad.join(\", \")}`);","typeGuard":null,"tryCatchPattern":"try {\n  const selector = parseSqliteSelector(subPath, queryString);\n} catch (err) {\n  if (err instanceof ToolError && err.message.includes(\"Unsupported SQLite query parameter\")) {\n    // strip unknown params or show allowed keys to the user\n  } else throw err;\n}","preventionTips":["Only ever build selectors from the documented params: limit, offset, order, where","Use ?where= for filtering, not ad-hoc filter params","Double-check spelling and case of parameter names","Prefer the q= raw query selector when you need anything beyond the four params"],"tags":["sqlite","validation","url-parameters"],"backgroundTag":"unsupported-query-parameter","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}