Working towards getting first SQS test passing.

This commit is contained in:
Sam Rose 2024-04-09 15:55:44 +01:00
parent c5580b4767
commit 2d36cf6c6a
No known key found for this signature in database
4 changed files with 10 additions and 10 deletions

View File

@ -32,7 +32,7 @@ export async function updateRelationshipColumns(
row: Row, row: Row,
rows: { [key: string]: Row }, rows: { [key: string]: Row },
relationships: RelationshipsJson[], relationships: RelationshipsJson[],
opts?: { internal?: boolean } opts?: { sqs?: boolean }
) { ) {
const columns: { [key: string]: any } = {} const columns: { [key: string]: any } = {}
for (let relationship of relationships) { for (let relationship of relationships) {
@ -55,7 +55,7 @@ export async function updateRelationshipColumns(
row, row,
table: linkedTable, table: linkedTable,
isLinked: true, isLinked: true,
internal: opts?.internal, internal: opts?.sqs,
}) })
if (!linked._id) { if (!linked._id) {
continue continue

View File

@ -117,7 +117,7 @@ export async function sqlOutputProcessing(
table: Table, table: Table,
tables: Record<string, Table>, tables: Record<string, Table>,
relationships: RelationshipsJson[], relationships: RelationshipsJson[],
opts?: { internal?: boolean } opts?: { sqs?: boolean }
): Promise<Row[]> { ): Promise<Row[]> {
if (!Array.isArray(rows) || rows.length === 0 || rows[0].read === true) { if (!Array.isArray(rows) || rows.length === 0 || rows[0].read === true) {
return [] return []
@ -146,7 +146,7 @@ export async function sqlOutputProcessing(
row, row,
table, table,
isLinked: false, isLinked: false,
internal: opts?.internal, internal: opts?.sqs,
}), }),
table table
) )

View File

@ -7,12 +7,12 @@ import { Datasource, FieldType, Table } from "@budibase/types"
jest.unmock("mssql") jest.unmock("mssql")
describe.each([ describe.each([
["internal", undefined], // ["internal", undefined],
["internal-sqs", undefined], ["internal-sqs", undefined],
[DatabaseName.POSTGRES, getDatasource(DatabaseName.POSTGRES)], //[DatabaseName.POSTGRES, getDatasource(DatabaseName.POSTGRES)],
[DatabaseName.MYSQL, getDatasource(DatabaseName.MYSQL)], //[DatabaseName.MYSQL, getDatasource(DatabaseName.MYSQL)],
[DatabaseName.SQL_SERVER, getDatasource(DatabaseName.SQL_SERVER)], //[DatabaseName.SQL_SERVER, getDatasource(DatabaseName.SQL_SERVER)],
[DatabaseName.MARIADB, getDatasource(DatabaseName.MARIADB)], //[DatabaseName.MARIADB, getDatasource(DatabaseName.MARIADB)],
])("/api/:sourceId/search (%s)", (name, dsProvider) => { ])("/api/:sourceId/search (%s)", (name, dsProvider) => {
const isSqs = name === "internal-sqs" const isSqs = name === "internal-sqs"
const config = setup.getConfig() const config = setup.getConfig()

View File

@ -179,7 +179,7 @@ export async function search(
allTablesMap, allTablesMap,
relationships, relationships,
{ {
internal: true, sqs: true,
} }
), ),
} }