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
This commit is contained in:
parent
f0f304c012
commit
781496383b
@ -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/),
|
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).
|
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
|
## 2.23.0 - 2023-11-15
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
@ -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…
x
Reference in New Issue
Block a user