* feat(create-medusa-app): update command for a better onboarding experience * use medusa-telemetry for tracking * update used snapshot * added changeset * update yarn.lock * increased facts timer * updated snapshot version * show facts throughout installation + add first_run to url * added message after server termination * print message only once * added github to process terminated message * address pr feedback * added onboarding seeding * fix for npm install
26 lines
416 B
TypeScript
26 lines
416 B
TypeScript
type ConnectionStringOptions = {
|
|
user?: string
|
|
password?: string
|
|
host?: string
|
|
db: string
|
|
}
|
|
|
|
export default ({ user, password, host, db }: ConnectionStringOptions) => {
|
|
let connection = `postgres://`
|
|
if (user) {
|
|
connection += user
|
|
}
|
|
|
|
if (password) {
|
|
connection += `:${password}`
|
|
}
|
|
|
|
if (user || password) {
|
|
connection += "@"
|
|
}
|
|
|
|
connection += `${host}/${db}`
|
|
|
|
return connection
|
|
}
|