Skip to content

Commit

Permalink
fix: boolean for sql_simple_queries (#886)
Browse files Browse the repository at this point in the history
For sql_simple_queries=2 elements of Boolean type are returned as
strings due to the output converter. To correct this, we disable the
boolean output converter for this feature flag.

---------

Co-authored-by: Johannes Vogel <[email protected]>
  • Loading branch information
larslutz96 and johannes-vogel authored Nov 13, 2024
1 parent 250edd5 commit d8139fa
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion sqlite/lib/SQLiteService.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,10 @@ class SQLiteService extends SQLService {
struct: expr => `${expr}->'$'`,
array: expr => `${expr}->'$'`,
// SQLite has no booleans so we need to convert 0 and 1
boolean: expr => `CASE ${expr} when 1 then 'true' when 0 then 'false' END ->'$'`,
boolean:
cds.env.features.sql_simple_queries === 2
? undefined
: expr => `CASE ${expr} when 1 then 'true' when 0 then 'false' END ->'$'`,
// DateTimes are returned without ms added by InputConverters
DateTime: e => `substr(${e},0,20)||'Z'`,
// Timestamps are returned with ms, as written by InputConverters.
Expand Down

0 comments on commit d8139fa

Please sign in to comment.