diff --git a/hana/lib/HANAService.js b/hana/lib/HANAService.js index 2627c0d7f..da12b0fef 100644 --- a/hana/lib/HANAService.js +++ b/hana/lib/HANAService.js @@ -933,8 +933,9 @@ class HANAService extends SQLService { LargeBinary: () => `NVARCHAR(2147483647)`, Binary: () => `NVARCHAR(2147483647)`, array: () => `NVARCHAR(2147483647)`, + Vector: () => `NVARCHAR(2147483647)`, - // Javascript types + // JavaScript types string: () => `NVARCHAR(2147483647)`, number: () => `DOUBLE` } @@ -947,6 +948,7 @@ class HANAService extends SQLService { // Not encoded string with CESU-8 or some UTF-8 except a surrogate pair at "base64_decode" function Binary: e => `HEXTOBIN(${e})`, Boolean: e => `CASE WHEN ${e} = 'true' THEN TRUE WHEN ${e} = 'false' THEN FALSE END`, + Vector: e => `TO_REAL_VECTOR(${e})`, } static OutputConverters = { @@ -957,6 +959,7 @@ class HANAService extends SQLService { Time: e => `to_char(${e}, 'HH24:MI:SS')`, DateTime: e => `to_char(${e}, 'YYYY-MM-DD"T"HH24:MI:SS"Z"')`, Timestamp: e => `to_char(${e}, 'YYYY-MM-DD"T"HH24:MI:SS.FF3"Z"')`, + Vector: e => `TO_NVARCHAR(${e})`, } } diff --git a/test/compliance/resources/db/basic/literals.cds b/test/compliance/resources/db/basic/literals.cds index 79d2d324a..6525ab78c 100644 --- a/test/compliance/resources/db/basic/literals.cds +++ b/test/compliance/resources/db/basic/literals.cds @@ -53,6 +53,13 @@ entity array { } entity binaries { - binary : Binary; - largebinary : LargeBinary; + binary : Binary; + largebinary : LargeBinary; } + + +/* Excluded from the tests until fully supported +entity vectors { + vector : Vector; +} +*/ \ No newline at end of file diff --git a/test/compliance/resources/db/basic/literals/basic.literals.vectors.js b/test/compliance/resources/db/basic/literals/basic.literals.vectors.js new file mode 100644 index 000000000..0edf9408b --- /dev/null +++ b/test/compliance/resources/db/basic/literals/basic.literals.vectors.js @@ -0,0 +1,9 @@ + +module.exports = [ + { + vector: null, + }, + { + vector: '[0.1,0.2,0.3]', + }, +]