Scott
04/27/2022, 7:53 AMtypeORM
for serverless-stack, or is the consensus to use kysely
instead? [Postgres Aurora Serverless]
(I'm converting an existing serverless project to serverless-stack that currently uses typeORM, so I'm weighing up the challenges of converting vs wiring up typeORM)Frank
kysely
, so shorter cold start time
• Kysely is complete typesafe which is handy if u r using TSFrank
Scott
04/27/2022, 11:57 PMScott
04/28/2022, 8:09 AMFrank
Frank
Scott
04/29/2022, 12:38 AMScott
04/29/2022, 4:54 AMScott
04/29/2022, 4:56 AMimport 'reflect-metadata';
import { DataSource } from 'typeorm';
import * as entities from './entities';
import { User } from './entities/entity/User';
import * as subscribers from './entities/subscriptions';
import * as migrations from './entities/migrations';
import 'typeorm-aurora-data-api-driver';
let AppDataSource = new DataSource({
type: 'postgres',
host: 'localhost',
port: 5432,
username: 'postgres',
password: 'admin',
database: 'postgres',
logging: true,
// entities: [...Object.values(entities)],
// subscribers: [...Object.values(subscribers)],
migrations: [...Object.values(migrations)],
});
if (process.env.SECRET_ARN) {
AppDataSource = new DataSource({
type: 'aurora-postgres',
database: 'medii',
secretArn: process.env.SECRET_ARN ?? '',
resourceArn: process.env.CLUSTER_ARN ?? '',
region: process.env.REGION ?? 'ap-southeast-2',
logging: true,
entities: [User],
// subscribers: [],
migrations: [...Object.values(migrations)],
});
}
export default AppDataSource;
Scott
04/29/2022, 6:47 AMKujtim Hoxha
05/16/2022, 11:22 AMKujtim Hoxha
05/16/2022, 11:23 AMKujtim Hoxha
05/16/2022, 11:46 AMKujtim Hoxha
05/16/2022, 11:47 AMtypeorm
to nodeModules
Kujtim Hoxha
05/16/2022, 11:49 AM@anatine/esbuild-decorators
Scott
05/17/2022, 4:44 AM