Created
June 16, 2021 12:54
-
-
Save headwinds/b48ee5aebc74f2858466b0f02a26c359 to your computer and use it in GitHub Desktop.
serverless postgreSQL config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Dialect } from 'sequelize/types'; | |
export const config = { | |
database: { | |
dialect: 'postgres' as Dialect, | |
host: 'ruby.db.elephantsql.com', | |
port: 5432, | |
username: 'your-username-here', | |
password: 'your-password-here', | |
database: 'your-database-here', | |
logging: false, | |
ssl: true, | |
pool: { | |
maxConnections: 1, | |
maxIdleTime: 1000, | |
}, | |
retry: { | |
match: [ | |
/ConnectionError/, | |
/SequelizeConnectionError/, | |
/SequelizeConnectionRefusedError/, | |
/SequelizeHostNotFoundError/, | |
/SequelizeHostNotReachableError/, | |
/SequelizeInvalidConnectionError/, | |
/SequelizeConnectionTimedOutError/, | |
/SequelizeConnectionAcquireTimeoutError/, | |
/Connection terminated unexpectedly/, | |
], | |
max: Infinity, | |
}, | |
synchronize: false, | |
migrationsRun: true, | |
migrations: [__dirname + '/migrations/**/*{.ts,.js}'], | |
cli: { | |
migrationsDir: 'db/migrations', | |
}, | |
}, | |
jwtPrivateKey: 'razzle-dazzle', | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment