Skip to content

Commit

Permalink
feat: SAP Hana support (#5246)
Browse files Browse the repository at this point in the history
* basic impl

* finished basic table metadata queries;

* implemented data types;

* working on data types;

* added test for column length;

* working on indices

* working on query runner

* working on schema builder

* removed SAP HANA client from dependencies

* fixed SAP uuid

* working on falling tests;

* working on falling tests;

* added docker configuration for sap hana

* simplifying sample entity

* implemented pool;

* trying to add SAP Hana to Circle CI

* trying to add SAP Hana to Circle CI

* trying to add SAP Hana to Circle CI

* testing CircleCI config

* testing CircleCI config

* added sap tests for ci

* changed sap port

* ci experiments

* ci experiments

* removing ci, adding docs

* removing ci

* minor fixes;

* fixed falling test;

Co-authored-by: AlexMesser <dmzt08@gmail.com>
  • Loading branch information
pleerock and AlexMesser committed Dec 23, 2019
1 parent d19162c commit ec90341
Show file tree
Hide file tree
Showing 95 changed files with 4,160 additions and 372 deletions.
24 changes: 24 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,30 @@ jobs:
POSTGRES_PASSWORD: "test"
POSTGRES_DB: "test"
- image: circleci/mongo:3.4.18
# - image: "store/saplabs/hanaexpress:2.00.040.00.20190729.1"
# auth:
# username: $DOCKER_USER
# password: $DOCKER_PASSWORD
## name: hanaexpress
## container_name: "typeorm-hanaexpress"
## hostname: hxe
# command: ['--passwords-url', 'https://raw.githubusercontent.com/typeorm/typeorm/b119f7c3b8748aea9c77c7bc42b8e1be209b43ec/docker/hana/hxe-config.json', '--agree-to-sap-license']
## ulimits:
## nofile: 1048576
## sysctls:
## - kernel.shmmax=1073741824
## - net.ipv4.ip_local_port_range=40000 60999
## - kernel.shmmni=524288
## - kernel.shmall=8388608
## volumes:
## - volume-hana-xe:/hana/mounts
## - ./docker/hana/hxe-config.json:/hana/hxe-config.json
## ports:
## - 39013:39013
## - 39017:39017
## - 39041-39045:39041-39045
## - 1128-1129:1128-1129
## - 59013-59014:59013-59014
# - image: mcr.microsoft.com/mssql/server:2017-GA-ubuntu
# environment:
# SA_PASSWORD: "Admin12345"
Expand Down
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@sap:registry=https://npm.sap.com
11 changes: 9 additions & 2 deletions README-zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ TypeORM 的一些特性:
- 支持闭包表模式
- 在模型或者分离的配置文件中声明模式
- json / xml / yml / env 格式的连接配置
- 支持 MySQL / MariaDB / Postgres / SQLite / Microsoft SQL Server / Oracle / sql.js
- 支持 MySQL / MariaDB / Postgres / SQLite / Microsoft SQL Server / Oracle / SAP Hana / sql.js
- 支持 MongoDB NoSQL 数据库
- 可在 NodeJS / 浏览器 / Ionic / Cordova / React Native / Expo / Electron 平台上使用
- 支持 TypeScript 和 JavaScript
Expand Down Expand Up @@ -198,9 +198,16 @@ await timber.remove();

查看 [支持的平台](/supported-platforms.md)

- **SAP Hana**

```
npm config set @sap:registry https://npm.sap.com
npm i @sap/hdbext
```

##### TypeScript 配置

此外,请确保你使用的 TypeScript 编译器版本是**2.3**或更高版本,并且已经在 `tsconfig.json` 中启用了以下设置:
此外,请确保你使用的 TypeScript 编译器版本是**3.3**或更高版本,并且已经在 `tsconfig.json` 中启用了以下设置:

```json
"emitDecoratorMetadata": true,
Expand Down
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Some TypeORM features:
* supports closure table pattern
* schema declaration in models or separate configuration files
* connection configuration in json / xml / yml / env formats
* supports MySQL / MariaDB / Postgres / CockroachDB / SQLite / Microsoft SQL Server / Oracle / sql.js
* supports MySQL / MariaDB / Postgres / CockroachDB / SQLite / Microsoft SQL Server / Oracle / SAP Hana / sql.js
* supports MongoDB NoSQL database
* works in NodeJS / Browser / Ionic / Cordova / React Native / NativeScript / Expo / Electron platforms
* TypeScript and JavaScript support
Expand Down Expand Up @@ -203,11 +203,16 @@ await timber.remove();

`npm install oracledb --save`

Install only *one* of them, depending on which database you use.

To make the Oracle driver work, you need to follow the installation instructions from
[their](https://github.com/oracle/node-oracledb) site.

* for **SAP Hana**

```
npm config set @sap:registry https://npm.sap.com
npm i @sap/hdbext
```

* for **MongoDB** (experimental)

`npm install mongodb --save`
Expand All @@ -216,11 +221,12 @@ await timber.remove();

Check [documentation of supported platforms](./docs/supported-platforms.md)

Install only *one* of them, depending on which database you use.


##### TypeScript configuration

Also, make sure you are using TypeScript compiler version **3.3** or greater,
Also, make sure you are using TypeScript version **3.3** or higher,
and you have enabled the following settings in `tsconfig.json`:

```json
Expand Down
26 changes: 26 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,29 @@ services:
ports:
- "26257:26257"

# sap hana (works only on linux)
# hanaexpress:
# image: "store/saplabs/hanaexpress:2.00.040.00.20190729.1"
# container_name: "typeorm-hanaexpress"
# hostname: hxe
# command: ['--passwords-url', 'file:////hana/hxe-config.json', '--agree-to-sap-license']
# ulimits:
# nofile: 1048576
# sysctls:
# - kernel.shmmax=1073741824
# - net.ipv4.ip_local_port_range=40000 60999
# - kernel.shmmni=524288
# - kernel.shmall=8388608
# volumes:
# - volume-hana-xe:/hana/mounts
# - ./docker/hana/hxe-config.json:/hana/hxe-config.json
# ports:
# - 39013:39013
# - 39017:39017
# - 39041-39045:39041-39045
# - 1128-1129:1128-1129
# - 59013-59014:59013-59014

# mongodb
mongodb:
image: "mongo:3.4.18"
Expand All @@ -82,3 +105,6 @@ services:
# container_name: "typeorm-redis"
# ports:
# - "6379:6379"

#volumes:
# volume-hana-xe:
3 changes: 3 additions & 0 deletions docker/hana/hxe-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"master_password" : "HXEHana1"
}
11 changes: 11 additions & 0 deletions ormconfig.circleci.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,17 @@
"password": "",
"database": "defaultdb"
},
{
"skip": true,
"name": "sap",
"type": "sap",
"host": "localhost",
"port": 39015,
"username": "SYSTEM",
"password": "HXEHana1",
"database": "HXE",
"logging": false
},
{
"skip": false,
"disabledIfNotEnabledImplicitly": true,
Expand Down
11 changes: 11 additions & 0 deletions ormconfig.json.dist
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,17 @@
"password": "",
"database": "defaultdb"
},
{
"skip": false,
"name": "sap",
"type": "sap",
"host": "192.168.56.102",
"port": 39015,
"username": "SYSTEM",
"password": "MySuperHanaPwd123!",
"database": "HXE",
"logging": false
},
{
"skip": false,
"disabledIfNotEnabledImplicitly": true,
Expand Down
Loading

0 comments on commit ec90341

Please sign in to comment.