Skip to content

Commit 6be39bd

Browse files
added geography type test
1 parent a226cbb commit 6be39bd

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import { Firebolt } from "../../../src/index";
2+
3+
const connectionParams = {
4+
auth: {
5+
client_id: process.env.FIREBOLT_CLIENT_ID as string,
6+
client_secret: process.env.FIREBOLT_CLIENT_SECRET as string
7+
},
8+
account: process.env.FIREBOLT_ACCOUNT as string,
9+
database: process.env.FIREBOLT_DATABASE as string,
10+
engineName: process.env.FIREBOLT_ENGINE_NAME as string
11+
};
12+
13+
jest.setTimeout(100000);
14+
15+
describe("geography", () => {
16+
it("handles select geo", async () => {
17+
const firebolt = Firebolt({
18+
apiEndpoint: process.env.FIREBOLT_API_ENDPOINT as string
19+
});
20+
21+
const connection = await firebolt.connect(connectionParams);
22+
23+
await connection.execute("SET advanced_mode=1");
24+
await connection.execute("SET enable_geography=true");
25+
26+
const statement = await connection.execute(
27+
"select 'POINT(1 1)'::geography;"
28+
);
29+
30+
const { data, meta } = await statement.fetchResult();
31+
expect(meta[0].type).toEqual("geography");
32+
const row = data[0];
33+
expect((row as unknown[])[0]).toEqual("0101000020E6100000FEFFFFFFFFFFEF3F000000000000F03F");
34+
});
35+
});

0 commit comments

Comments
 (0)