Fix boolean searching for external datasources.

This commit is contained in:
Sam Rose 2024-05-03 17:31:44 +01:00
parent 1777f1f8fe
commit 1edc525d9b
No known key found for this signature in database
2 changed files with 7 additions and 12 deletions

View File

@ -175,11 +175,7 @@ export async function sqlOutputProcessing(
throw new Error("Unable to generate row ID for SQL rows")
}
if (opts?.sqs) {
finalRows[thisRow._id] = fixBooleanFields({ row: thisRow, table })
} else {
finalRows[thisRow._id] = thisRow
}
finalRows[thisRow._id] = fixBooleanFields({ row: thisRow, table })
// do this at end once its been added to the final rows
finalRows = await updateRelationshipColumns(

View File

@ -15,17 +15,16 @@ import {
TableSchema,
} from "@budibase/types"
import _ from "lodash"
import exp from "constants"
jest.unmock("mssql")
describe.each([
// ["lucene", undefined],
["lucene", undefined],
["sqs", undefined],
// [DatabaseName.POSTGRES, getDatasource(DatabaseName.POSTGRES)],
// [DatabaseName.MYSQL, getDatasource(DatabaseName.MYSQL)],
// [DatabaseName.SQL_SERVER, getDatasource(DatabaseName.SQL_SERVER)],
// [DatabaseName.MARIADB, getDatasource(DatabaseName.MARIADB)],
[DatabaseName.POSTGRES, getDatasource(DatabaseName.POSTGRES)],
[DatabaseName.MYSQL, getDatasource(DatabaseName.MYSQL)],
[DatabaseName.SQL_SERVER, getDatasource(DatabaseName.SQL_SERVER)],
[DatabaseName.MARIADB, getDatasource(DatabaseName.MARIADB)],
])("/api/:sourceId/search (%s)", (name, dsProvider) => {
const isSqs = name === "sqs"
const isLucene = name === "lucene"
@ -167,7 +166,7 @@ describe.each([
return expectSearch({ query })
}
describe.only("boolean", () => {
describe("boolean", () => {
beforeAll(async () => {
await createTable({
isTrue: { name: "isTrue", type: FieldType.BOOLEAN },