Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/frontend-core/src/components/UserAvatars.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<script lang="ts">
import { Avatar, TooltipPosition } from "@supertoolmake/bbui"
import { UserAvatar } from "@supertoolmake/frontend-core"
import UserAvatar from "./UserAvatar.svelte"
import type { UIUser } from "@supertoolmake/types"

type OrderType = "ltr" | "rtl"
Expand Down
6 changes: 5 additions & 1 deletion packages/shared-core/src/helpers/integrations.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import { SourceName } from "@supertoolmake/types"

export function isSQL(datasource: { source: SourceName; isSQL?: boolean }): boolean {
export function isSQL(datasource: { source: SourceName; isSQL?: boolean } | undefined): boolean {
if (!datasource) {
return false
}

const SQL = [SourceName.POSTGRES, SourceName.SQL_SERVER, SourceName.MYSQL]
return SQL.indexOf(datasource.source) !== -1 || datasource.isSQL === true
}
14 changes: 14 additions & 0 deletions packages/shared-core/src/helpers/tests/integrations.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { SourceName } from "@supertoolmake/types"
import { isSQL } from "../integrations"

describe("integration helpers", () => {
describe("isSQL", () => {
it("returns false when the datasource is unavailable", () => {
expect(isSQL(undefined)).toBe(false)
})

it("returns true for SQL datasources", () => {
expect(isSQL({ source: SourceName.POSTGRES })).toBe(true)
})
})
})
Loading