Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
134 changes: 131 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@
"@bufbuild/protobuf": "^1.10.0",
"@connectrpc/connect": "^1.6.0",
"@connectrpc/connect-web": "^1.6.0",
"exponential-backoff": "^3.1.1"
"exponential-backoff": "^3.1.1",
"mongodb": "^6.10.0"
},
"devDependencies": {
"@bufbuild/buf": "^1.15.0-1",
Expand Down
5 changes: 3 additions & 2 deletions src/app/data-client.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { BSON } from 'mongodb'
import { Struct, Timestamp, type JsonValue } from '@bufbuild/protobuf';
import { createRouterTransport, type Transport } from '@connectrpc/connect';
import { beforeEach, describe, expect, it, vi } from 'vitest';
Expand Down Expand Up @@ -108,7 +109,7 @@ describe('DataClient tests', () => {
service(DataService, {
tabularDataBySQL: () => {
return new TabularDataBySQLResponse({
data: data.map((x) => Struct.fromJson(x)),
rawData: data.map((x) => BSON.serialize(x)),
});
},
});
Expand All @@ -134,7 +135,7 @@ describe('DataClient tests', () => {
service(DataService, {
tabularDataByMQL: () => {
return new TabularDataByMQLResponse({
data: data.map((x) => Struct.fromJson(x)),
rawData: data.map((x) => BSON.serialize(x)),
});
},
});
Expand Down
5 changes: 3 additions & 2 deletions src/app/data-client.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { BSON } from 'mongodb';
import { Struct, Timestamp, type JsonValue } from '@bufbuild/protobuf';
import {
createPromiseClient,
Expand Down Expand Up @@ -64,7 +65,7 @@ export class DataClient {
organizationId,
sqlQuery: query,
});
return resp.data.map((value) => value.toJson());
return resp.rawData.map((bsonBytes) => BSON.deserialize(bsonBytes));
}

/**
Expand All @@ -79,7 +80,7 @@ export class DataClient {
organizationId,
mqlBinary: query,
});
return resp.data.map((value) => value.toJson());
return resp.rawData.map((bsonBytes) => BSON.deserialize(bsonBytes));
}

/**
Expand Down
Loading