@abaplint/transpiler 2.3.102 → 2.3.103
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -52,16 +52,20 @@ class SQLiteDatabaseSchema {
|
|
|
52
52
|
return "";
|
|
53
53
|
}
|
|
54
54
|
const fields = [];
|
|
55
|
+
const fieldsRaw = [];
|
|
55
56
|
for (const field of type.getComponents()) {
|
|
56
57
|
if (field.type instanceof abaplint.BasicTypes.StructureType) {
|
|
57
58
|
// is a GROUP NAME
|
|
58
59
|
continue;
|
|
59
60
|
}
|
|
61
|
+
fieldsRaw.push(field.name.toLowerCase());
|
|
60
62
|
fields.push("'" + field.name.toLowerCase() + "' " + this.toType(field.type, field.name, tabl.getName()));
|
|
61
63
|
}
|
|
62
64
|
// assumption: all transparent tables have primary keys
|
|
63
65
|
// add single quotes to field names to allow for keywords as field names
|
|
64
|
-
const key = ", PRIMARY KEY(" + tabl.listKeys(this.reg)
|
|
66
|
+
const key = ", PRIMARY KEY(" + tabl.listKeys(this.reg)
|
|
67
|
+
.filter(e => fieldsRaw.includes(e.toLowerCase()))
|
|
68
|
+
.map(e => "'" + e.toLowerCase() + "'").join(",") + ")";
|
|
65
69
|
return `CREATE TABLE '${tabl.getName().toLowerCase()}' (${fields.join(", ")}${key});\n`;
|
|
66
70
|
}
|
|
67
71
|
toType(type, fieldname, errorInfo) {
|