Skip to content

Commit

Permalink
fix 'having' singlstore-prefixed.test.ts integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Rodriguespn committed Aug 30, 2024
1 parent 976129d commit e79e6e9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
14 changes: 7 additions & 7 deletions integration-tests/tests/singlestore/singlestore-common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,9 @@ import { afterAll, beforeEach, describe, expect, expectTypeOf, test } from 'vite
import { Expect, toLocalDate } from '~/utils.ts';
import type { Equal } from '~/utils.ts';

import fs from 'fs';
import path from 'path';
import { fileURLToPath } from 'url';
import fs from 'fs';


type TestSingleStoreDB = SingleStoreDatabase<any, any>;

Expand Down Expand Up @@ -190,8 +189,6 @@ const citiesMySchemaTable = mySchema.table('cities', {
name: text('name').notNull(),
});



let singlestoreContainer: Docker.Container;
export async function createDockerDB(): Promise<{ connectionString: string; container: Docker.Container }> {
const docker = new Docker();
Expand All @@ -209,7 +206,6 @@ export async function createDockerDB(): Promise<{ connectionString: string; cont
docker.modem.followProgress(pullStream, (err) => (err ? reject(err) : resolve(err)))
);


singlestoreContainer = await docker.createContainer({
Image: image,
Env: ['ROOT_PASSWORD=singlestore'],
Expand Down Expand Up @@ -1269,7 +1265,11 @@ export function tests(driver?: string) {
test('insert via db.execute + select via db.execute', async (ctx) => {
const { db } = ctx.singlestore;

await db.execute(sql`insert into ${usersTable} (${new Name(usersTable.id.name)},${new Name(usersTable.name.name)}) values (1,${'John'})`);
await db.execute(
sql`insert into ${usersTable} (${new Name(usersTable.id.name)},${new Name(
usersTable.name.name,
)}) values (1,${'John'})`,
);

const result = await db.execute<{ id: number; name: string }>(sql`select id, name from ${usersTable}`);
expect(result[0]).toEqual([{ id: 1, name: 'John' }]);
Expand Down Expand Up @@ -1766,7 +1766,7 @@ export function tests(driver?: string) {
.from(users2Table)
.as('sq');

const res = await db.select({ name: sq.name }).from(sq).orderBy(asc(users2Table.id))
const res = await db.select({ name: sq.name }).from(sq).orderBy(asc(users2Table.id));

expect(res).toEqual([{ name: 'John modified' }, { name: 'Jane modified' }]);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1049,6 +1049,7 @@ test('having', async () => {
}]);

await db.insert(users2Table).values([{ id: 1, name: 'John', cityId: 1 }, { id: 2, name: 'Jane', cityId: 1 }, {
id: 3,
name: 'Jack',
cityId: 2,
}]);
Expand Down

0 comments on commit e79e6e9

Please sign in to comment.