-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcode-gear.mssql.js
52 lines (52 loc) · 1.76 KB
/
code-gear.mssql.js
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
module.exports = {
type: 'mssql',
database: {
server: 'localhost',
database: 'sampledb',
user: 'sa',
password: '123456',
pool: {
max: 10,
min: 0,
idleTimeoutMillis: 30000,
},
options: {
encrypt: false, // true for azure
trustServerCertificate: true, // change to true for local dev / self-signed certs
},
},
template: {
imports: './templates/imports_mssql.js',
target: './.generate',
templates: [
{
splitType: 1, // 1= table split每个table 一个文件 0 =所有的table 一个文件
path: './templates/vulcanEntity.art', //相对的模板路劲
targetFile: function (t) {
var arrParts = t.tableName.split('_');
var resArr = [];
resArr.push('./');
arrParts.forEach((a) => {
if (!a) {
return '';
}
var s = a.replace(
/\b(\w)(\w*)/g,
function ($0, $1, $2) {
return $1.toUpperCase() + $2.toLowerCase();
}
);
resArr.push(s);
});
resArr.push('.cs');
return resArr.join('');
},
extend: {
//额外的变量
nameSpace: 'Sample.Impl.Model',
baseModel: 'Sample.Impl.Model.BaseModel',
},
},
],
},
};