Skip to content

Commit

Permalink
Added support for ST_GEOMETRY and ST_POINT (#255)
Browse files Browse the repository at this point in the history
- Added support for ST_GEOMETRY and ST_POINT by treating them as binary types
    - ST_GEOMETRY and ST_POINT can only be sent as buffers
- Updated integration tests to only run data type tests when the required data format is met
- Added integration tests for ST_GEOMETRY and ST_POINT
  • Loading branch information
he-is-harry authored Jan 28, 2025
1 parent 3ff9c3e commit 58eec9d
Show file tree
Hide file tree
Showing 8 changed files with 213 additions and 68 deletions.
3 changes: 2 additions & 1 deletion lib/protocol/common/DataFormatVersion.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ module.exports = {
// deprecated
EXTENDED_DATE_TIME_SUPPORT: 3,
LEVEL4: 4,
LEVEL5: 5,
// Maximum data format version supported by this driver
MAX_VERSION: 4,
MAX_VERSION: 5,
};
2 changes: 2 additions & 0 deletions lib/protocol/common/NormalizedTypeCode.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ NormalizedTypeCode[TypeCode.NSTRING] = TypeCode.NSTRING;
NormalizedTypeCode[TypeCode.BINARY] = TypeCode.BINARY;
NormalizedTypeCode[TypeCode.VARBINARY] = TypeCode.BINARY;
NormalizedTypeCode[TypeCode.BSTRING] = TypeCode.BINARY;
NormalizedTypeCode[TypeCode.ST_GEOMETRY] = TypeCode.BINARY;
NormalizedTypeCode[TypeCode.ST_POINT] = TypeCode.BINARY;
// BLob
NormalizedTypeCode[TypeCode.BLOB] = TypeCode.BLOB;
NormalizedTypeCode[TypeCode.LOCATOR] = TypeCode.BLOB;
Expand Down
2 changes: 2 additions & 0 deletions lib/protocol/common/ReadFunction.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,5 @@ ReadFunction[TypeCode.TEXT] = READ_NCLOB;
ReadFunction[TypeCode.DOUBLE] = READ_DOUBLE;
ReadFunction[TypeCode.REAL] = READ_FLOAT;
ReadFunction[TypeCode.DECIMAL] = READ_DECIMAL;
ReadFunction[TypeCode.ST_GEOMETRY] = READ_BINARY;
ReadFunction[TypeCode.ST_POINT] = READ_BINARY;
4 changes: 3 additions & 1 deletion lib/protocol/common/TypeCode.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,7 @@ module.exports = {
CSTIME: 66,
BLOB_DISK: 71,
CLOB_DISK: 72,
NCLOB_DISK: 73
NCLOB_DISK: 73,
ST_GEOMETRY: 74,
ST_POINT: 75,
};
1 change: 1 addition & 0 deletions lib/protocol/part/ConnectOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ function ConnectOptions() {
// * `4` Baseline data type support (SAP HANA SPS 06)
// Support for ALPHANUM, TEXT, SHORTTEXT, LONGDATE, SECONDDATE,
// DAYDATE, and SECONDTIME.
// * `5` Support for ST_GEOMETRY and ST_POINT
// TODO: Once implementation and testing for data format version 4 are
// complete, replace dataFormatVersion and dataFormatVersion2 with the
// commented-out lines.
Expand Down
Loading

0 comments on commit 58eec9d

Please sign in to comment.