change structure generates data commands

This commit is contained in:
Jan Prochazka
2023-02-16 13:14:56 +01:00
parent cd1267b464
commit edf0637a35
8 changed files with 127 additions and 24 deletions

View File

@@ -115,3 +115,15 @@ export function getAsImageSrc(obj) {
return null;
}
export function parseSqlDefaultValue(value: string) {
if (!value) return undefined;
if (!_isString(value)) return undefined;
if (value.startsWith("'") && value.endsWith("'")) {
return value.slice(1, -1);
}
if (!isNaN(value as any) && !isNaN(parseFloat(value))) {
return parseFloat(value);
}
return undefined;
}