-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ce29e61
commit cda9879
Showing
47 changed files
with
2,649 additions
and
133 deletions.
There are no files selected for viewing
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import nodefony from "nodefony"; | ||
|
||
/** | ||
* OVERRIDE ORM BUNDLE MONGOOSE | ||
* | ||
* @see MONGO BUNDLE config for more options | ||
* @more options https://mongoosejs.com/docs/connections.html | ||
* https://mongoosejs.com/docs/api.html#mongoose_Mongoose-createConnection | ||
* | ||
* By default nodefony create connector name nodefony | ||
* for manage Sessions / Users | ||
*/ | ||
|
||
const connectors = { | ||
nodefony: {}, | ||
}; | ||
|
||
switch (nodefony.kernel?.appEnvironment.environment) { | ||
case "production": | ||
case "development": | ||
default: | ||
connectors.nodefony = { | ||
host: "localhost", | ||
port: 27017, | ||
dbname: "nodefony", | ||
// credentials: vault, | ||
options: { | ||
user: "nodefony", | ||
pass: "nodefony", | ||
maxPoolSize: 50, | ||
serverSelectionTimeoutMS: 5000, | ||
socketTimeoutMS: 5000, | ||
connectTimeoutMS: 5000, | ||
}, | ||
}; | ||
} | ||
|
||
const config = { | ||
debug: true, | ||
connectors, | ||
}; | ||
|
||
export default 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
import path from "path"; | ||
import nodefony, { Kernel } from "nodefony"; | ||
import { sequelize } from "@nodefony/sequelize"; | ||
|
||
const config = { | ||
connectors: { | ||
nodefony: { | ||
driver: "sqlite", | ||
dbname: path.resolve( | ||
(nodefony.kernel as Kernel).path, | ||
"nodefony", | ||
"databases", | ||
"nodefony.db" | ||
), | ||
options: { | ||
dialect: "sqlite", | ||
// isolationLevel: Transaction.ISOLATION_LEVELS.SERIALIZABLE, | ||
retry: { | ||
match: [/Deadlock/i, "SQLITE_BUSY"], | ||
max: 5, | ||
}, | ||
pool: { | ||
max: 5, | ||
min: 0, | ||
idle: 10000, | ||
}, | ||
}, | ||
}, | ||
// nodefony: { | ||
// driver: "mysql", | ||
// dbname: "nodefony", | ||
// username: "root", | ||
// password: "nodefony", | ||
// //credentials: vault, | ||
// options: { | ||
// dialect: "mysql", | ||
// host: "localhost", | ||
// port: "3306", | ||
// //isolationLevel: Transaction.ISOLATION_LEVELS.SERIALIZABLE, | ||
// retry: { | ||
// match: [ | ||
// sequelize.ConnectionError, | ||
// sequelize.ConnectionTimedOutError, | ||
// sequelize.TimeoutError, | ||
// /Deadlock/i, | ||
// ], | ||
// max: 5, | ||
// }, | ||
// pool: { | ||
// max: 20, | ||
// min: 0, | ||
// idle: 10000, | ||
// acquire: 60000, | ||
// }, | ||
// }, | ||
// }, | ||
// nodefony: { | ||
// driver: "postgres", | ||
// dbname: "nodefony", | ||
// username: "postgres", | ||
// password: "nodefony", | ||
// //credentials: vault, | ||
// options: { | ||
// dialect: "postgres", | ||
// host: "localhost", | ||
// port: "5432", | ||
// //isolationLevel: Transaction.ISOLATION_LEVELS.SERIALIZABLE, | ||
// retry: { | ||
// match: [ | ||
// sequelize.ConnectionError, | ||
// sequelize.ConnectionTimedOutError, | ||
// sequelize.TimeoutError, | ||
// /Deadlock/i, | ||
// ], | ||
// max: 5, | ||
// }, | ||
// pool: { | ||
// max: 20, | ||
// min: 0, | ||
// idle: 10000, | ||
// acquire: 60000, | ||
// }, | ||
// }, | ||
// }, | ||
}, | ||
}; | ||
|
||
export default config; |
Oops, something went wrong.