import { createConnection , getConnection , getManager , } from 'typeorm' ; import { User } from '../app/entities' ; export const schema = { additionalProperties : false , properties : { } , required : [ ] , type : 'object' , } ; export async function main ( ) { const user = new User ( ) ; await createConnection ( ) ; try { console . log ( await getManager ( ) . save ( user ) ) ; } catch ( error ) { console . log ( error . message ) ; } finally { await getConnection ( ) . close ( ) ; } }