Browse Source

Attempt to fix "too many bind variables in prepared statement, expected maximum of 32767"

pull/2659/head
Thomas 2 years ago
parent
commit
10d7416f61
  1. 24
      apps/api/src/services/market-data/market-data.service.ts

24
apps/api/src/services/market-data/market-data.service.ts

@ -64,7 +64,7 @@ export class MarketDataService {
dateQuery: DateQuery; dateQuery: DateQuery;
uniqueAssets: UniqueAsset[]; uniqueAssets: UniqueAsset[];
}): Promise<MarketData[]> { }): Promise<MarketData[]> {
return await this.prismaService.marketData.findMany({ return this.prismaService.marketData.findMany({
orderBy: [ orderBy: [
{ {
date: 'asc' date: 'asc'
@ -74,17 +74,17 @@ export class MarketDataService {
} }
], ],
where: { where: {
OR: uniqueAssets.map(({ dataSource, symbol }) => { dataSource: {
return { in: uniqueAssets.map(({ dataSource }) => {
AND: [ return dataSource;
{ })
dataSource, },
symbol, date: dateQuery,
date: dateQuery symbol: {
} in: uniqueAssets.map(({ symbol }) => {
] return symbol;
}; })
}) }
} }
}); });
} }

Loading…
Cancel
Save