Skip to content

Commit

Permalink
Merge branch 'frontend-core-ts-2' of github.com:Budibase/budibase int…
Browse files Browse the repository at this point in the history
…o ts-portal-admin-store
  • Loading branch information
aptkingston committed Dec 13, 2024
2 parents b57aa16 + cb8f052 commit 5319fb3
Show file tree
Hide file tree
Showing 19 changed files with 446 additions and 192 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 5319fb3

Please sign in to comment.