express-sweet 3.0.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [3.0.1] - 2025/9/2
|
|
6
|
+
|
|
7
|
+
### Changed
|
|
8
|
+
|
|
9
|
+
- Add pool configuration examples and JSDoc documentation to sample database configuration.
|
|
10
|
+
- [ESM Configuration](configuration_sample/esm/database.js)
|
|
11
|
+
- [CJS Configuration](configuration_sample/cjs/database.js)
|
|
12
|
+
|
|
5
13
|
## [3.0.0] - 2025/8/26
|
|
6
14
|
|
|
7
15
|
This release introduces significant improvements to database layer architecture and adds configurable logging support.
|
|
@@ -694,4 +702,5 @@ const db = await expx.database.DatabaseManager.getInstance();
|
|
|
694
702
|
[2.0.7]: https://github.com/takuya-motoshima/express-sweet/compare/v2.0.6...v2.0.7
|
|
695
703
|
[2.0.8]: https://github.com/takuya-motoshima/express-sweet/compare/v2.0.7...v2.0.8
|
|
696
704
|
[2.0.9]: https://github.com/takuya-motoshima/express-sweet/compare/v2.0.8...v2.0.9
|
|
697
|
-
[3.0.0]: https://github.com/takuya-motoshima/express-sweet/compare/v2.0.9...v3.0.0
|
|
705
|
+
[3.0.0]: https://github.com/takuya-motoshima/express-sweet/compare/v2.0.9...v3.0.0
|
|
706
|
+
[3.0.1]: https://github.com/takuya-motoshima/express-sweet/compare/v3.0.0...v3.0.1
|
|
@@ -1,7 +1,53 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Database
|
|
2
|
+
* Sequelize Database Configuration
|
|
3
|
+
*
|
|
4
|
+
* @description Database connection settings for different environments
|
|
5
|
+
* Includes connection pool configuration for each environment
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* // Connection pool configuration examples
|
|
9
|
+
* // The max value must be set appropriately according to the DB's max_connections
|
|
10
|
+
*
|
|
11
|
+
* // How to check max_connections in MariaDB:
|
|
12
|
+
* // SHOW VARIABLES LIKE 'max_connections';
|
|
13
|
+
* // +-----------------+-------+
|
|
14
|
+
* // | Variable_name | Value |
|
|
15
|
+
* // +-----------------+-------+
|
|
16
|
+
* // | max_connections | 151 |
|
|
17
|
+
* // +-----------------+-------+
|
|
18
|
+
*
|
|
19
|
+
* // Configuration example when max_connections=151:
|
|
20
|
+
* pool: {
|
|
21
|
+
* // Maximum 100 connections (66.2% usage of max_connections=151)
|
|
22
|
+
* // Keep total connections from all instances within 70-80% of max_connections
|
|
23
|
+
* max: 100,
|
|
24
|
+
* // Maintain 10 connections constantly (ensures stability during load increases)
|
|
25
|
+
* min: 10,
|
|
26
|
+
* // 10 second timeout for connection acquisition
|
|
27
|
+
* acquire: 10000,
|
|
28
|
+
* // Mark for deletion after 3 seconds of inactivity
|
|
29
|
+
* idle: 3000,
|
|
30
|
+
* // Check for idle connections every 10 seconds
|
|
31
|
+
* evict: 10000
|
|
32
|
+
* }
|
|
33
|
+
*
|
|
34
|
+
* // Configuration example when max_connections=5297:
|
|
35
|
+
* pool: {
|
|
36
|
+
* // Maximum 300 connections per instance (6 instances peak = 1800 connections = 34.0% usage)
|
|
37
|
+
* // Distribute connections across multiple instances while staying within safe limits
|
|
38
|
+
* max: 300,
|
|
39
|
+
* // Maintain 30 connections constantly (ensures stability during high load)
|
|
40
|
+
* min: 30,
|
|
41
|
+
* // 30 second timeout for connection acquisition
|
|
42
|
+
* acquire: 30000,
|
|
43
|
+
* // Mark for deletion after 10 seconds of inactivity
|
|
44
|
+
* idle: 10000,
|
|
45
|
+
* // Check for idle connections every 30 seconds
|
|
46
|
+
* evict: 30000
|
|
47
|
+
* }
|
|
3
48
|
*/
|
|
4
49
|
module.exports = {
|
|
50
|
+
// Development environment configuration
|
|
5
51
|
development: {
|
|
6
52
|
username: 'root',
|
|
7
53
|
password: 'password',
|
|
@@ -10,8 +56,22 @@ module.exports = {
|
|
|
10
56
|
port: undefined,
|
|
11
57
|
dialect: 'mariadb',
|
|
12
58
|
timezone: '+09:00',
|
|
13
|
-
logging: false
|
|
59
|
+
logging: false,
|
|
60
|
+
// pool: {
|
|
61
|
+
// // Maximum connections (adjust based on your DB's max_connections)
|
|
62
|
+
// max: 100,
|
|
63
|
+
// // Maintain minimum connections constantly
|
|
64
|
+
// min: 10,
|
|
65
|
+
// // Connection acquisition timeout
|
|
66
|
+
// acquire: 10000,
|
|
67
|
+
// // Mark for deletion after inactivity
|
|
68
|
+
// idle: 2000,
|
|
69
|
+
// // Check for idle connections interval
|
|
70
|
+
// evict: 10000
|
|
71
|
+
// }
|
|
14
72
|
},
|
|
73
|
+
|
|
74
|
+
// Test environment configuration
|
|
15
75
|
test: {
|
|
16
76
|
username: 'root',
|
|
17
77
|
password: 'password',
|
|
@@ -20,8 +80,22 @@ module.exports = {
|
|
|
20
80
|
port: undefined,
|
|
21
81
|
dialect: 'mariadb',
|
|
22
82
|
timezone: '+09:00',
|
|
23
|
-
logging: false
|
|
83
|
+
logging: false,
|
|
84
|
+
// pool: {
|
|
85
|
+
// // Maximum connections (adjust based on your DB's max_connections)
|
|
86
|
+
// max: 100,
|
|
87
|
+
// // Maintain minimum connections constantly
|
|
88
|
+
// min: 10,
|
|
89
|
+
// // Connection acquisition timeout
|
|
90
|
+
// acquire: 10000,
|
|
91
|
+
// // Mark for deletion after inactivity
|
|
92
|
+
// idle: 3000,
|
|
93
|
+
// // Check for idle connections interval
|
|
94
|
+
// evict: 10000
|
|
95
|
+
// }
|
|
24
96
|
},
|
|
97
|
+
|
|
98
|
+
// Production environment configuration
|
|
25
99
|
production: {
|
|
26
100
|
username: 'root',
|
|
27
101
|
password: 'password',
|
|
@@ -30,6 +104,18 @@ module.exports = {
|
|
|
30
104
|
port: undefined,
|
|
31
105
|
dialect: 'mariadb',
|
|
32
106
|
timezone: '+09:00',
|
|
33
|
-
logging: false
|
|
107
|
+
logging: false,
|
|
108
|
+
// pool: {
|
|
109
|
+
// // Maximum connections (adjust based on your DB's max_connections and instance count)
|
|
110
|
+
// max: 300,
|
|
111
|
+
// // Maintain minimum connections constantly
|
|
112
|
+
// min: 30,
|
|
113
|
+
// // Connection acquisition timeout
|
|
114
|
+
// acquire: 30000,
|
|
115
|
+
// // Mark for deletion after inactivity
|
|
116
|
+
// idle: 10000,
|
|
117
|
+
// // Check for idle connections interval
|
|
118
|
+
// evict: 30000
|
|
119
|
+
// }
|
|
34
120
|
}
|
|
35
121
|
}
|
|
@@ -1,7 +1,53 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Database
|
|
2
|
+
* Sequelize Database Configuration
|
|
3
|
+
*
|
|
4
|
+
* @description Database connection settings for different environments
|
|
5
|
+
* Includes connection pool configuration for each environment
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* // Connection pool configuration examples
|
|
9
|
+
* // The max value must be set appropriately according to the DB's max_connections
|
|
10
|
+
*
|
|
11
|
+
* // How to check max_connections in MariaDB:
|
|
12
|
+
* // SHOW VARIABLES LIKE 'max_connections';
|
|
13
|
+
* // +-----------------+-------+
|
|
14
|
+
* // | Variable_name | Value |
|
|
15
|
+
* // +-----------------+-------+
|
|
16
|
+
* // | max_connections | 151 |
|
|
17
|
+
* // +-----------------+-------+
|
|
18
|
+
*
|
|
19
|
+
* // Configuration example when max_connections=151:
|
|
20
|
+
* pool: {
|
|
21
|
+
* // Maximum 100 connections (66.2% usage of max_connections=151)
|
|
22
|
+
* // Keep total connections from all instances within 70-80% of max_connections
|
|
23
|
+
* max: 100,
|
|
24
|
+
* // Maintain 10 connections constantly (ensures stability during load increases)
|
|
25
|
+
* min: 10,
|
|
26
|
+
* // 10 second timeout for connection acquisition
|
|
27
|
+
* acquire: 10000,
|
|
28
|
+
* // Mark for deletion after 3 seconds of inactivity
|
|
29
|
+
* idle: 3000,
|
|
30
|
+
* // Check for idle connections every 10 seconds
|
|
31
|
+
* evict: 10000
|
|
32
|
+
* }
|
|
33
|
+
*
|
|
34
|
+
* // Configuration example when max_connections=5297:
|
|
35
|
+
* pool: {
|
|
36
|
+
* // Maximum 300 connections per instance (6 instances peak = 1800 connections = 34.0% usage)
|
|
37
|
+
* // Distribute connections across multiple instances while staying within safe limits
|
|
38
|
+
* max: 300,
|
|
39
|
+
* // Maintain 30 connections constantly (ensures stability during high load)
|
|
40
|
+
* min: 30,
|
|
41
|
+
* // 30 second timeout for connection acquisition
|
|
42
|
+
* acquire: 30000,
|
|
43
|
+
* // Mark for deletion after 10 seconds of inactivity
|
|
44
|
+
* idle: 10000,
|
|
45
|
+
* // Check for idle connections every 30 seconds
|
|
46
|
+
* evict: 30000
|
|
47
|
+
* }
|
|
3
48
|
*/
|
|
4
49
|
export default {
|
|
50
|
+
// Development environment configuration
|
|
5
51
|
development: {
|
|
6
52
|
username: 'root',
|
|
7
53
|
password: 'password',
|
|
@@ -10,8 +56,22 @@ export default {
|
|
|
10
56
|
port: undefined,
|
|
11
57
|
dialect: 'mariadb',
|
|
12
58
|
timezone: '+09:00',
|
|
13
|
-
logging: false
|
|
59
|
+
logging: false,
|
|
60
|
+
// pool: {
|
|
61
|
+
// // Maximum connections (adjust based on your DB's max_connections)
|
|
62
|
+
// max: 100,
|
|
63
|
+
// // Maintain minimum connections constantly
|
|
64
|
+
// min: 10,
|
|
65
|
+
// // Connection acquisition timeout
|
|
66
|
+
// acquire: 10000,
|
|
67
|
+
// // Mark for deletion after inactivity
|
|
68
|
+
// idle: 2000,
|
|
69
|
+
// // Check for idle connections interval
|
|
70
|
+
// evict: 10000
|
|
71
|
+
// }
|
|
14
72
|
},
|
|
73
|
+
|
|
74
|
+
// Test environment configuration
|
|
15
75
|
test: {
|
|
16
76
|
username: 'root',
|
|
17
77
|
password: 'password',
|
|
@@ -20,8 +80,22 @@ export default {
|
|
|
20
80
|
port: undefined,
|
|
21
81
|
dialect: 'mariadb',
|
|
22
82
|
timezone: '+09:00',
|
|
23
|
-
logging: false
|
|
83
|
+
logging: false,
|
|
84
|
+
// pool: {
|
|
85
|
+
// // Maximum connections (adjust based on your DB's max_connections)
|
|
86
|
+
// max: 100,
|
|
87
|
+
// // Maintain minimum connections constantly
|
|
88
|
+
// min: 10,
|
|
89
|
+
// // Connection acquisition timeout
|
|
90
|
+
// acquire: 10000,
|
|
91
|
+
// // Mark for deletion after inactivity
|
|
92
|
+
// idle: 3000,
|
|
93
|
+
// // Check for idle connections interval
|
|
94
|
+
// evict: 10000
|
|
95
|
+
// }
|
|
24
96
|
},
|
|
97
|
+
|
|
98
|
+
// Production environment configuration
|
|
25
99
|
production: {
|
|
26
100
|
username: 'root',
|
|
27
101
|
password: 'password',
|
|
@@ -30,6 +104,18 @@ export default {
|
|
|
30
104
|
port: undefined,
|
|
31
105
|
dialect: 'mariadb',
|
|
32
106
|
timezone: '+09:00',
|
|
33
|
-
logging: false
|
|
107
|
+
logging: false,
|
|
108
|
+
// pool: {
|
|
109
|
+
// // Maximum connections (adjust based on your DB's max_connections and instance count)
|
|
110
|
+
// max: 300,
|
|
111
|
+
// // Maintain minimum connections constantly
|
|
112
|
+
// min: 30,
|
|
113
|
+
// // Connection acquisition timeout
|
|
114
|
+
// acquire: 30000,
|
|
115
|
+
// // Mark for deletion after inactivity
|
|
116
|
+
// idle: 10000,
|
|
117
|
+
// // Check for idle connections interval
|
|
118
|
+
// evict: 30000
|
|
119
|
+
// }
|
|
34
120
|
}
|
|
35
121
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "express-sweet",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "EXPRESS SWEET is a powerful Express.js extension that streamlines your workflow and boosts productivity with a suite of utilities and enhancements.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/build.cjs",
|