Closed
Description
Issue description
aggregate function throw error when column alias name is set
Expected Behavior
Actual Behavior
Steps to reproduce
import {
BaseEntity,
Column,
Entity,
createConnection, PrimaryGeneratedColumn
} from 'typeorm';
@Entity({ database: 'test', name: 'tb_serial_no' })
export class SerialNoEntity extends BaseEntity {
@PrimaryGeneratedColumn()
id: number;
@Column({
type: 'int',
name: 'serial_no_id',
nullable: false,
default: 0,
})
serialNoId: number;
}
async function boostrap() {
const connection = await createConnection({
type: "mariadb",
host: "localhost",
port: 3306,
username: "root",
password: "123123",
database: "test",
entities: [SerialNoEntity],
});
const count = await SerialNoEntity.maximum('serialNoId', {})
console.log(count) // it should be printed
}
boostrap();
My Environment
Dependency | Version |
---|---|
Operating System | Mac Os |
Node.js version | 16.17.0 |
Typescript version | 4.9.5 |
TypeORM version | 0.3.12 |
Additional Context
No response
Relevant Database Driver(s)
- aurora-mysql
- aurora-postgres
- better-sqlite3
- cockroachdb
- cordova
- expo
- mongodb
- mysql
- nativescript
- oracle
- postgres
- react-native
- sap
- spanner
- sqlite
- sqlite-abstract
- sqljs
- sqlserver
Are you willing to resolve this issue by submitting a Pull Request?
Yes, I have the time, and I know how to start.