This commit is contained in:
mike12345567 2024-09-04 13:11:03 +01:00
parent 2d6a8d9ff5
commit fed82dffaf
2 changed files with 1 additions and 17 deletions

View File

@ -128,7 +128,7 @@ class InternalBuilder {
} }
private generateSelectStatement(): (string | Knex.Raw)[] | "*" { private generateSelectStatement(): (string | Knex.Raw)[] | "*" {
const { endpoint, resource, meta, tableAliases } = this.query const { endpoint, resource, tableAliases } = this.query
if (!resource || !resource.fields || resource.fields.length === 0) { if (!resource || !resource.fields || resource.fields.length === 0) {
return "*" return "*"

View File

@ -7,11 +7,9 @@ import {
ManyToManyRelationshipFieldMetadata, ManyToManyRelationshipFieldMetadata,
RelationshipFieldMetadata, RelationshipFieldMetadata,
RelationshipsJson, RelationshipsJson,
Row,
Table, Table,
} from "@budibase/types" } from "@budibase/types"
import { breakExternalTableId } from "../../../../integrations/utils" import { breakExternalTableId } from "../../../../integrations/utils"
import { basicProcessing } from "./basic"
import { generateJunctionTableID } from "../../../../db/utils" import { generateJunctionTableID } from "../../../../db/utils"
type TableMap = Record<string, Table> type TableMap = Record<string, Table>
@ -22,20 +20,6 @@ export function isManyToMany(
return !!(field as ManyToManyRelationshipFieldMetadata).through return !!(field as ManyToManyRelationshipFieldMetadata).through
} }
function isCorrectRelationship(
relationship: RelationshipsJson,
table1: Table,
table2: Table,
row: Row
): boolean {
const junctionTableId = generateJunctionTableID(table1._id!, table2._id!)
const possibleColumns = [
`${junctionTableId}.doc1.fieldName`,
`${junctionTableId}.doc2.fieldName`,
]
return !!possibleColumns.find(col => row[col] === relationship.column)
}
/** /**
* Gets the list of relationship JSON structures based on the columns in the table, * Gets the list of relationship JSON structures based on the columns in the table,
* this will be used by the underlying library to build whatever relationship mechanism * this will be used by the underlying library to build whatever relationship mechanism