从数据库获取表结构直接生成代码

This commit is contained in:
QM303176530
2020-07-05 22:07:22 +08:00
parent 9068ca6ea7
commit e27066d9ac
7 changed files with 72 additions and 15 deletions

View File

@@ -10,4 +10,11 @@ export const toUpperCase = (str) => {
export const toSQLLine = (str) => {
if (str=="ID") return "ID"
return str.replace(/([A-Z])/g,"_$1").toLowerCase();
}
}
// 下划线转换驼峰
export const toHump = (name) => {
return name.replace(/\_(\w)/g, function(all, letter){
return letter.toUpperCase();
});
}