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

This commit is contained in:
QM303176530
2020-07-05 22:07:22 +08:00
parent e9f101043b
commit b286ff6df6
7 changed files with 72 additions and 15 deletions
+8 -1
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();
});
}