{"id":"e3618df201d7dd1b","repo":"typeorm/typeorm","slug":"to-use-streams-you-should-install-pg-query-stream","errorCode":null,"errorMessage":"To use streams you should install pg-query-stream package. Please run \"npm i pg-query-stream\".","messagePattern":"To use streams you should install pg-query-stream package\\. Please run \"npm i pg-query-stream\"\\.","errorType":"exception","errorClass":"TypeORMError","httpStatus":null,"severity":"error","filePath":"src/driver/cockroachdb/CockroachDriver.ts","lineNumber":1130,"sourceCode":"     * @param index\n     */\n    createParameter(parameterName: string, index: number): string {\n        return this.parametersPrefix + (index + 1)\n    }\n\n    // -------------------------------------------------------------------------\n    // Public Methods\n    // -------------------------------------------------------------------------\n\n    /**\n     * Loads postgres query stream package.\n     */\n    loadStreamDependency() {\n        try {\n            return PlatformTools.load(\"pg-query-stream\")\n        } catch {\n            // todo: better error for browser env\n            throw new TypeORMError(\n                `To use streams you should install pg-query-stream package. Please run \"npm i pg-query-stream\".`,\n            )\n        }\n    }\n\n    // -------------------------------------------------------------------------\n    // Protected Methods\n    // -------------------------------------------------------------------------\n\n    /**\n     * If driver dependency is not given explicitly, then try to load it via \"require\".\n     */\n    protected loadDependencies(): void {\n        try {\n            const postgres = this.options.driver ?? PlatformTools.load(\"pg\")\n            this.postgres = postgres\n            try {\n                const pgNative =","sourceCodeStart":1112,"sourceCodeEnd":1148,"githubUrl":"https://github.com/typeorm/typeorm/blob/04ff4daedcf60fa4ffd0d5d33bbafaac1a9bbc96/src/driver/cockroachdb/CockroachDriver.ts#L1112-L1148","documentation":"Error \"To use streams you should install pg-query-stream package. Please run \"npm i pg-query-stream\".\" thrown in typeorm/typeorm.","triggerScenarios":"QueryRunner.stream() is called on a CockroachDB connection without the optional pg-query-stream package installed in the project.","commonSituations":"See trigger scenarios.","solutions":["Install the streaming package: npm i pg-query-stream","Avoid using query streaming if you cannot add the dependency; use getMany() instead."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"04ff4daedcf60fa4ffd0d5d33bbafaac1a9bbc96","analyzedAt":"2026-08-03T18:27:32.281Z","schemaVersion":2}