agrs-sequelize-sdk 1.0.0 → 1.0.2

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/index.js CHANGED
@@ -10,14 +10,20 @@ class DBModels {
10
10
 
11
11
  // Initialize Sequelize
12
12
  const sequelize = new Sequelize(
13
- this.config .database,
14
- this.config .username,
15
- this.config .password,
13
+ this.config.database,
14
+ this.config.username,
15
+ this.config.password,
16
16
  {
17
- host: this.config .host,
18
- dialect: this.config .dialect,
19
- port: this.config .port,
17
+ host: this.config.host,
18
+ dialect: this.config.dialect,
19
+ port: this.config.port,
20
20
  logging: false,
21
+ dialectOptions: {
22
+ ssl: {
23
+ require: true, // Require SSL
24
+ rejectUnauthorized: false, // For self-signed or unverified certificates
25
+ },
26
+ },
21
27
  pool: {
22
28
  max: 100,
23
29
  min: 0,
@@ -66,4 +72,22 @@ class DBModels {
66
72
  }
67
73
  }
68
74
 
75
+ const config = {
76
+ username: 'avnadmin',
77
+ password: 'AVNS_nRgOZOZ4v1We_KncNYr',
78
+ database: 'defaultdb',
79
+ host: 'pg-7f50792-dev-7212.l.aivencloud.com',
80
+ port: 28333, // Replace with the appropriate port for your database
81
+ dialect: 'postgres', // Replace with your dialect (e.g., 'postgres', 'mysql')
82
+ };
83
+
84
+ (async () => {
85
+ // Initialize Sequelize models and apply any pending migrations (if included in your SDK)
86
+ const Db = new DBModels(config);
87
+ const db = Db.db;
88
+ // Example usage of the models
89
+ console.log(db);
90
+
91
+ })();
92
+
69
93
  module.exports = DBModels;
package/models/Users.js CHANGED
@@ -1,5 +1,3 @@
1
- const { Organization } = require("facebook-nodejs-business-sdk");
2
- const { or } = require("sequelize");
3
1
 
4
2
  module.exports = (sequelize, DataTypes) => {
5
3
  const Users = sequelize.define(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agrs-sequelize-sdk",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "start": "node index.js",