@abaplint/transpiler 2.13.49 → 2.13.50
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.
- package/build/src/db/schema_generation/database_schema_generator.d.ts +1 -0
- package/build/src/db/schema_generation/database_schema_generator.js +5 -0
- package/build/src/db/schema_generation/pg_database_schema.js +2 -1
- package/build/src/db/schema_generation/snowflake_database_schema.js +2 -1
- package/build/src/db/schema_generation/sqlite_database_schema.js +2 -1
- package/package.json +1 -1
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.packedTypeToDatabase = packedTypeToDatabase;
|
|
4
|
+
function packedTypeToDatabase(type) {
|
|
5
|
+
const precision = type.getLength() * 2 - 1;
|
|
6
|
+
return `DECIMAL(${precision},${type.getDecimals()})`;
|
|
7
|
+
}
|
|
3
8
|
//# sourceMappingURL=database_schema_generator.js.map
|
|
@@ -35,6 +35,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.PGDatabaseSchema = void 0;
|
|
37
37
|
const abaplint = __importStar(require("@abaplint/core"));
|
|
38
|
+
const database_schema_generator_1 = require("./database_schema_generator");
|
|
38
39
|
const _database_schema_reuse_1 = require("./_database_schema_reuse");
|
|
39
40
|
const QUOTE = "\"";
|
|
40
41
|
class PGDatabaseSchema {
|
|
@@ -99,7 +100,7 @@ class PGDatabaseSchema {
|
|
|
99
100
|
return `REAL`;
|
|
100
101
|
}
|
|
101
102
|
else if (type instanceof abaplint.BasicTypes.PackedType) {
|
|
102
|
-
return
|
|
103
|
+
return (0, database_schema_generator_1.packedTypeToDatabase)(type);
|
|
103
104
|
}
|
|
104
105
|
else if (type instanceof abaplint.BasicTypes.VoidType) {
|
|
105
106
|
throw `Type of ${errorInfo}-${fieldname} is VoidType(${type.getVoided()}), make sure the type is known, enable strict syntax checking`;
|
|
@@ -35,6 +35,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.SnowflakeDatabaseSchema = void 0;
|
|
37
37
|
const abaplint = __importStar(require("@abaplint/core"));
|
|
38
|
+
const database_schema_generator_1 = require("./database_schema_generator");
|
|
38
39
|
class SnowflakeDatabaseSchema {
|
|
39
40
|
reg;
|
|
40
41
|
constructor(reg) {
|
|
@@ -98,7 +99,7 @@ class SnowflakeDatabaseSchema {
|
|
|
98
99
|
return `REAL`;
|
|
99
100
|
}
|
|
100
101
|
else if (type instanceof abaplint.BasicTypes.PackedType) {
|
|
101
|
-
return
|
|
102
|
+
return (0, database_schema_generator_1.packedTypeToDatabase)(type);
|
|
102
103
|
}
|
|
103
104
|
else if (type instanceof abaplint.BasicTypes.VoidType) {
|
|
104
105
|
throw `Type of ${errorInfo}-${fieldname} is VoidType(${type.getVoided()}), make sure the type is known, enable strict syntax checking`;
|
|
@@ -35,6 +35,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.SQLiteDatabaseSchema = void 0;
|
|
37
37
|
const abaplint = __importStar(require("@abaplint/core"));
|
|
38
|
+
const database_schema_generator_1 = require("./database_schema_generator");
|
|
38
39
|
const _database_schema_reuse_1 = require("./_database_schema_reuse");
|
|
39
40
|
const QUOTE = "'";
|
|
40
41
|
class SQLiteDatabaseSchema {
|
|
@@ -100,7 +101,7 @@ class SQLiteDatabaseSchema {
|
|
|
100
101
|
return `REAL`;
|
|
101
102
|
}
|
|
102
103
|
else if (type instanceof abaplint.BasicTypes.PackedType) {
|
|
103
|
-
return
|
|
104
|
+
return (0, database_schema_generator_1.packedTypeToDatabase)(type);
|
|
104
105
|
}
|
|
105
106
|
else if (type instanceof abaplint.BasicTypes.VoidType) {
|
|
106
107
|
throw `Type of ${errorInfo}-${fieldname} is VoidType(${type.getVoided()}), make sure the type is known, enable strict syntax checking`;
|