Skip to content

Commit

Permalink
Merge branch 'master' into cheeks-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
aptkingston authored Dec 13, 2024
2 parents 3be6800 + 8144f04 commit df8e7bf
Show file tree
Hide file tree
Showing 18 changed files with 444 additions and 190 deletions.
8 changes: 4 additions & 4 deletions globalSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import {
getContainerRuntimeClient,
} from "testcontainers"
import { ContainerInfo } from "dockerode"
import path from "path"
import lockfile from "proper-lockfile"
import * as path from "path"
import * as lockfile from "proper-lockfile"
import { execSync } from "child_process"

interface DockerContext {
Expand All @@ -29,8 +29,8 @@ function getCurrentDockerContext(): DockerContext {

async function getBudibaseContainers() {
const client = await getContainerRuntimeClient()
const conatiners = await client.container.list()
return conatiners.filter(
const containers = await client.container.list()
return containers.filter(
container =>
container.Labels["com.budibase"] === "true" &&
container.Labels["org.testcontainers"] === "true"
Expand Down
12 changes: 8 additions & 4 deletions packages/backend-core/src/sql/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,15 @@ export function isExternalTable(table: Table) {
}

export function buildExternalTableId(datasourceId: string, tableName: string) {
// encode spaces
if (tableName.includes(" ")) {
tableName = encodeURIComponent(tableName)
return `${datasourceId}${DOUBLE_SEPARATOR}${encodeURIComponent(tableName)}`
}

export function encodeTableId(tableId: string) {
if (isExternalTableID(tableId)) {
return encodeURIComponent(tableId)
} else {
return tableId
}
return `${datasourceId}${DOUBLE_SEPARATOR}${tableName}`
}

export function breakExternalTableId(tableId: string) {
Expand Down
Loading

0 comments on commit df8e7bf

Please sign in to comment.