xxxxxxxxxx
cd -
/*will show /Users/yourname/Movies if you are in the Movies Folder*/
xxxxxxxxxx
import os
# Get the current working directory
current_folder = os.getcwd()
# Open the terminal in the current folder
os.system(f'open -a Terminal {current_folder}')
typeorm error message: no pg_hba.conf entry for
xxxxxxxxxx
import { DataSource, EntitySchema, MixedList } from 'typeorm'
import { Environment } from '~/configs/config.env'
import { Injectable } from '~/helpers/helper.di'
@Injectable()
export class Database {
initialize(entities: MixedList<Function | string | EntitySchema>): DataSource {
return new DataSource({
type: 'postgres',
host: Environment.POSTGRES_HOST,
port: Environment.POSTGRES_PORT,
username: Environment.POSTGRES_USERNAME,
password: Environment.POSTGRES_PASSWORD,
database: Environment.POSTGRES_DB,
entities: entities,
synchronize: Environment.POSTGRES_SYNC,
logger: !['production', 'staging'].includes(Environment.NODE_ENV) ? 'advanced-console' : undefined,
logging: !['production', 'staging'].includes(Environment.NODE_ENV) ? true : false,
ssl: {
rejectUnauthorized: false,
noDelay: true
}
})
}
}