We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue type:
[ ] question [ ] bug report [x] feature request [ ] documentation issue
Database system/driver:
[ ] cordova [ ] mongodb [ ] mssql [ ] mysql / mariadb [ x] oracle [ ] postgres [ ] cockroachdb [ ] sqlite [ ] sqljs [ ] react-native [ ] expo
cordova
mongodb
mssql
mysql
mariadb
oracle
postgres
cockroachdb
sqlite
sqljs
react-native
expo
TypeORM version:
[x ] latest [ ] @next [ ] 0.x.x (or put your version here)
latest
@next
0.x.x
Steps to reproduce or a small repository showing the problem:
Can't use SYSDATE in date column fields for Oracle because of this line https://github.com/typeorm/typeorm/blob/master/src/driver/oracle/OracleDriver.ts#L364 the logic tries to parse the string or function being passed down.
Sample Oracle Query
INSERT INTO SOME_TABLE (Last_Upd_By, Last_Upd_Date) VALUES ( P_Last_Upd_By, SYSDATE);
Sample Code: Entity:
@Column('date', { nullable: true, name: 'CANCEL_REQ_DATE' }) CANCEL_REQ_DATE: Date | null; @Column('date', { nullable: true, name: 'PLAN_END_DATE' }) PLAN_END_DATE: Date | null; @Column('varchar2', { nullable: true, length: 20, name: 'LAST_UPD_BY' }) LAST_UPD_BY: string | null;
insertion:
LAST_UPD_BY: lastUpdatedBy, CANCEL_REQ_DATE: 'SYSDATE', // for issue sample LAST_UPD_DATE: () => 'SYSDATE', // for issue sample });
Both SYSDATE format gives error.
Possible solutions may include adding a conditional on line #360
if (typeof value === 'function') { return value }
Above proposed solution will give alot of flexibility to the users to run their desired queries/SQL functions if they don't want the default behavior.
The current workaround on my end includes creating a patch file that patches that piece of code at the time of my docker container creation.
I can make a PR if we are fine with my proposed solution.
Thanks! RJ
The text was updated successfully, but these errors were encountered:
fix: Oracle sql expression for date column (#5305)
40e9d3a
* fix: resolves oracle sql expression bug for date columns Closes: #4452 * fix: resolves sql expression bug in insert query builder Closes: #4452
Successfully merging a pull request may close this issue.
Issue type:
[ ] question
[ ] bug report
[x] feature request
[ ] documentation issue
Database system/driver:
[ ]
cordova
[ ]
mongodb
[ ]
mssql
[ ]
mysql
/mariadb
[ x]
oracle
[ ]
postgres
[ ]
cockroachdb
[ ]
sqlite
[ ]
sqljs
[ ]
react-native
[ ]
expo
TypeORM version:
[x ]
latest
[ ]
@next
[ ]
0.x.x
(or put your version here)Steps to reproduce or a small repository showing the problem:
Can't use SYSDATE in date column fields for Oracle because of this line
https://github.com/typeorm/typeorm/blob/master/src/driver/oracle/OracleDriver.ts#L364
the logic tries to parse the string or function being passed down.
Sample Oracle Query
Sample Code:
Entity:
insertion:
Both SYSDATE format gives error.
Possible solutions may include adding a conditional on line #360
Above proposed solution will give alot of flexibility to the users to run their desired queries/SQL functions if they don't want the default behavior.
The current workaround on my end includes creating a patch file that patches that piece of code at the time of my docker container creation.
I can make a PR if we are fine with my proposed solution.
Thanks!
RJ
The text was updated successfully, but these errors were encountered: