rsim / oracle-enhanced

Oracle enhaced adapter for ActiveRecord
MIT License
545 stars 308 forks source link

varchar to boolean mapping. #2305

Open abhitiwari1322 opened 2 years ago

abhitiwari1322 commented 2 years ago

I have an existing application with Postgres, where boolean values are considered as TRUE/FALSE. I want to migrate it to Oracle. Queries like Model.where(attribute: TRUE) are failing because oracle supports either 0/1 OR Y/N.

I consider changing in driver so that queries with true/false behave the same as 0/1 or Y/N.

Expected behavior

Model.where(attribute: TRUE) It should return data.

Actual behavior

Model.where(attribute: TRUE) ActiveRecord::StatementInvalid: OCIError: ORA-00904: "TRUE": invalid identifier:

Rails version: 5.2

akostadinov commented 1 year ago

Why not use a different column type on Oracle?