T-135: M2.3b — libs/data/questdb query layer for QuestDB 10.2.0: LATEST ON + parameterized PGWire queries + contract DDL for bars_1m / fx_1m / bar_revisions (pure, no live QuestDB)
This commit is contained in:
parent
c6bd028dcc
commit
35d5de815b
8 changed files with 1523 additions and 305 deletions
|
|
@ -252,19 +252,20 @@ describe('QuestDB', () => {
|
|||
|
||||
const builder = new QuestDBQueryBuilder(mockClient);
|
||||
|
||||
const query = builder
|
||||
const { sql, params } = builder
|
||||
.select('symbol', 'close', 'volume')
|
||||
.from('ohlcv_data')
|
||||
.whereSymbol('AAPL')
|
||||
.orderBy('timestamp', 'DESC')
|
||||
.limit(100)
|
||||
.build();
|
||||
.buildParameterized();
|
||||
|
||||
expect(query).toContain('SELECT symbol, close, volume');
|
||||
expect(query).toContain('FROM ohlcv_data');
|
||||
expect(query).toContain("symbol = 'AAPL'");
|
||||
expect(query).toContain('ORDER BY timestamp DESC');
|
||||
expect(query).toContain('LIMIT 100');
|
||||
expect(sql).toContain('SELECT symbol, close, volume');
|
||||
expect(sql).toContain('FROM ohlcv_data');
|
||||
expect(sql).toContain('symbol = $1');
|
||||
expect(sql).toContain('ORDER BY timestamp DESC');
|
||||
expect(sql).toContain('LIMIT $2');
|
||||
expect(params).toEqual(['AAPL', 100]);
|
||||
});
|
||||
|
||||
it('should build query with time range', () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue