Skip to content

SAP HANA Driver using text column type for simple-array and simple-enum which is unsupported #6985

@sickmartian

Description

@sickmartian

Issue Description

With an entity using @column("simple-array") the creation statement will fail in SAP HANA.

Expected Behavior

Creation statement works, arrays in a single string work as well

Actual Behavior

Error: sql syntax error: incorrect syntax near "text": line 1 col 511 (at pos 511)
2020-10-28T14:43:40.591+0000 [APP/PROC/WEB/0] OUT     at /home/vcap/app/node_modules/typeorm/driver/sap/SapQueryRunner.js (/home/vcap/app/node_modules/typeorm/driver/sap/SapQueryRunner.js:183:74)
2020-10-28T14:43:40.591+0000 [APP/PROC/WEB/0] OUT     at /home/vcap/app/node_modules/typeorm/node_modules/tslib/tslib.js.step (/home/vcap/app/node_modules/typeorm/node_modules/tslib/tslib.js:141:27)
2020-10-28T14:43:40.591+0000 [APP/PROC/WEB/0] OUT     at /home/vcap/app/node_modules/typeorm/node_modules/tslib/tslib.js (/home/vcap/app/node_modules/typeorm/node_modules/tslib/tslib.js:122:57)
2020-10-28T14:43:40.591+0000 [APP/PROC/WEB/0] OUT     at /home/vcap/app/node_modules/typeorm/node_modules/tslib/tslib.js.fulfilled (/home/vcap/app/node_modules/typeorm/node_modules/tslib/tslib.js:112:62)

Steps to Reproduce

@Entity()
export class AwesomeEntity {
    @PrimaryColumn()
    id: string;

    @Column("simple-array")
    myField: string[] = [];

    constructor(data: Partial<AwesomeEntity>) {
        Object.assign(this, data);
    }
}

My Environment

I'm using nestjs.

Dependency Version
Operating System MacOS 10.14.6 (18G6032)
Node.js version v10.20.1
Typescript version typescript@3.9.7
TypeORM version typeorm@0.2.25

(I've checked the latest version of typeorm as well)

Additional Context

Issue seems to be here

return "text";

Relevant Database Driver(s)

  • aurora-data-api
  • aurora-data-api-pg
  • better-sqlite3
  • cockroachdb
  • cordova
  • expo
  • mongodb
  • mysql
  • nativescript
  • oracle
  • postgres
  • react-native
  • sap
  • sqlite
  • sqlite-abstract
  • sqljs
  • sqlserver

Are you willing to resolve this issue by submitting a Pull Request?

  • Yes, I have the time, and I know how to start.
  • Yes, I have the time, but I don't know how to start. I would need guidance.
  • No, I don't have the time, although I believe I could do it if I had the time...
  • No, I don't have the time and I wouldn't even know how to start.

I can try, I think I know where the issue is, but I'm not familiar with how internally the project works, specially regarding build and testing.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions