Bugfix/improve get range query in market data service (#2659)

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

* Update changelog
pull/2660/head
Thomas Kaul 7 months ago committed by GitHub
parent f0f304c012
commit 781496383b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## Unreleased
### Fixed
- Fixed the "too many bind variables in prepared statement" issue of the data range functionality (`getRange()`) in the market data service
## 2.23.0 - 2023-11-15
### Added

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

Loading…
Cancel
Save