Skip to content

Commit

Permalink
Enable BigInt results in Quick Evals
Browse files Browse the repository at this point in the history
  • Loading branch information
d10c committed Oct 11, 2024
1 parent fb3c00b commit ac60ba3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
7 changes: 5 additions & 2 deletions extensions/ql-vscode/src/common/bqrs-cli-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export namespace BqrsColumnKindCode {
export const BOOLEAN = "b";
export const DATE = "d";
export const ENTITY = "e";
export const BIGINT = "z";
}

export type BqrsColumnKind =
Expand All @@ -19,7 +20,8 @@ export type BqrsColumnKind =
| typeof BqrsColumnKindCode.STRING
| typeof BqrsColumnKindCode.BOOLEAN
| typeof BqrsColumnKindCode.DATE
| typeof BqrsColumnKindCode.ENTITY;
| typeof BqrsColumnKindCode.ENTITY
| typeof BqrsColumnKindCode.BIGINT;

export interface BqrsSchemaColumn {
name?: string;
Expand Down Expand Up @@ -79,7 +81,8 @@ export type BqrsKind =
| "Integer"
| "Boolean"
| "Date"
| "Entity";
| "Entity"
| "BigInt";

interface BqrsColumn {
name?: string;
Expand Down
2 changes: 2 additions & 0 deletions extensions/ql-vscode/src/common/bqrs-raw-results-mapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ function mapColumnKind(kind: BqrsColumnKind): ColumnKind {
return ColumnKind.Date;
case BqrsColumnKindCode.ENTITY:
return ColumnKind.Entity;
case BqrsColumnKindCode.BIGINT:
return ColumnKind.BigInt;
default:
assertNever(kind);
}
Expand Down
9 changes: 8 additions & 1 deletion extensions/ql-vscode/src/common/raw-result-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export enum ColumnKind {
Boolean = "boolean",
Date = "date",
Entity = "entity",
BigInt = "bigint",
}

export type Column = {
Expand Down Expand Up @@ -61,6 +62,11 @@ type CellValueNumber = {
value: number;
};

type CellValueBigInt = {
type: "number";
value: number;
};

type CellValueString = {
type: "string";
value: string;
Expand All @@ -75,7 +81,8 @@ export type CellValue =
| CellValueEntity
| CellValueNumber
| CellValueString
| CellValueBoolean;
| CellValueBoolean
| CellValueBigInt;

export type Row = CellValue[];

Expand Down

0 comments on commit ac60ba3

Please sign in to comment.