Skip to content

Commit

Permalink
chore: fix rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
B4nan committed Apr 26, 2023
1 parent 254042d commit 188ba57
Show file tree
Hide file tree
Showing 6 changed files with 1,243 additions and 1,405 deletions.
4 changes: 2 additions & 2 deletions packages/cli/src/commands/CreateSeederCommand.ts
Expand Up @@ -17,8 +17,8 @@ export class CreateSeederCommand<T> implements CommandModule<T, { seeder: string
/**
* @inheritDoc
*/
async handler(args: ArgumentsCamelCase<{ seeder: string }>) {
const className = CreateSeederCommand.getSeederClassName(args.seeder);
async handler(args: ArgumentsCamelCase<{ seeder?: string }>) {
const className = CreateSeederCommand.getSeederClassName(args.seeder!);
const orm = await CLIHelper.getORM();
const seeder = orm.getSeeder();
const path = await seeder.createSeeder(className);
Expand Down
4 changes: 2 additions & 2 deletions packages/knex/src/AbstractSqlPlatform.ts
Expand Up @@ -103,10 +103,10 @@ export abstract class AbstractSqlPlatform extends Platform {
return raw(alias => `json_extract(${this.quoteIdentifier(`${alias}.${a}`)}, '$.${b.map(quoteKey).join('.')}')`);
}

return `json_extract(${this.quoteIdentifier(a)}, '$.${b.map(quoteKey).join('.')}')`;
return raw(`json_extract(${this.quoteIdentifier(a)}, '$.${b.map(quoteKey).join('.')}')`);
}

overrideisRaw(value: any): boolean {
override isRaw(value: any): boolean {
return super.isRaw(value) || (typeof value === 'object' && value !== null && value.client && ['Ref', 'Raw'].includes(value.constructor.name));
}

Expand Down
1 change: 0 additions & 1 deletion packages/postgresql/src/PostgreSqlPlatform.ts
Expand Up @@ -273,7 +273,6 @@ export class PostgreSqlPlatform extends AbstractSqlPlatform {
switch (prop?.columnTypes?.[0]) {
case this.getUuidTypeDeclarationSQL({}): return '::text';
case this.getBooleanTypeDeclarationSQL(): return '::int';
case 'json': return '::jsonb';
default: return '';
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/features/serialization/GH4263.test.ts
Expand Up @@ -42,6 +42,6 @@ test('serialization with nulls', async () => {
const expDto = { id: '1', details: { code: 2 } };
await orm.em.insert(ListEntity2Test, expDto);
const entity = await orm.em.findOneOrFail(ListEntity2Test, { id: '1' });
const dto = serialize(entity, { skipNull: true });
const [dto] = serialize(entity, { skipNull: true });
expect(dto).toEqual(expDto);
});
4 changes: 2 additions & 2 deletions tests/features/unit-of-work/GH4266.test.ts
Expand Up @@ -76,11 +76,11 @@ test('update triggered after insert (GH #4266)', async () => {

expect(mock.mock.calls).toEqual([
['[query] begin'],
['[query] insert into `a` (`id`, `name`) values (1, \'a\') returning `id`'],
['[query] insert into `a` (`id`, `name`) values (1, \'a\')'],
['[query] commit'],
['[query] select `a0`.* from `a` as `a0` where `a0`.`name` = \'a\' limit 1'],
['[query] begin'],
['[query] insert into `b` (`id`, `name`, `a_id`) values (2, \'b\', 1) returning `id`'],
['[query] insert into `b` (`id`, `name`, `a_id`) values (2, \'b\', 1)'],
['[query] commit'],
]);
});

0 comments on commit 188ba57

Please sign in to comment.