-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLocal.mjs
63 lines (60 loc) · 1.76 KB
/
Local.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/**
* Local configuration DTO for the plugin.
* @see TeqFw_Core_Back_Config
*/
// MODULE'S VARS
const NS = 'TeqFw_Db_Back_Dto_Config_Local';
// MODULE'S CLASSES
export default class TeqFw_Db_Back_Dto_Config_Local {
/** @type {string} */
client;
/** @type {TeqFw_Db_Back_Dto_Config_Local_Connection} */
connection;
/**
* PostgreSQL client allows you to set the initial search path for each connection automatically.
* @type {string[]}
*/
searchPath;
/**
* SQLite: replace undefined keys with NULL instead of DEFAULT.
*
* @type {boolean}
*/
useNullAsDefault;
/**
* When you use the PostgreSQL adapter to connect a non-standard database.
* @type {string}
*/
version;
}
/**
* Factory to create new DTO instances.
* @memberOf TeqFw_Db_Back_Dto_Config_Local
*/
export class Factory {
static namespace = NS;
/**
* @param {TeqFw_Core_Shared_Util_Cast} cast
* @param {TeqFw_Db_Back_Dto_Config_Local_Connection.Factory} fConn
*/
constructor(
{
TeqFw_Core_Shared_Util_Cast$: cast,
'TeqFw_Db_Back_Dto_Config_Local_Connection.Factory$': fConn,
}
) {
/**
* @param {TeqFw_Db_Back_Dto_Config_Local|null} data
* @returns {TeqFw_Db_Back_Dto_Config_Local}
*/
this.create = function (data = null) {
const res = new TeqFw_Db_Back_Dto_Config_Local();
res.client = cast.string(data?.client);
res.connection = fConn.create(data?.connection);
res.searchPath = cast.arrayOfStr(data?.searchPath);
res.useNullAsDefault = cast.boolean(data?.useNullAsDefault);
res.version = cast.string(data?.version);
return res;
};
}
}