Respond to PR feedback.
This commit is contained in:
parent
a1eb0fffb4
commit
2458259093
|
@ -1,9 +1,14 @@
|
||||||
<script>
|
<script>
|
||||||
import { FieldType, BBReferenceFieldSubType } from "@budibase/types"
|
import {
|
||||||
|
FieldType,
|
||||||
|
BBReferenceFieldSubType,
|
||||||
|
SourceName,
|
||||||
|
} from "@budibase/types"
|
||||||
import { Select, Toggle, Multiselect } from "@budibase/bbui"
|
import { Select, Toggle, Multiselect } from "@budibase/bbui"
|
||||||
import { DB_TYPE_INTERNAL } from "constants/backend"
|
import { DB_TYPE_INTERNAL } from "constants/backend"
|
||||||
import { API } from "api"
|
import { API } from "api"
|
||||||
import { parseFile } from "./utils"
|
import { parseFile } from "./utils"
|
||||||
|
import { tables, datasources } from "stores/builder"
|
||||||
|
|
||||||
let error = null
|
let error = null
|
||||||
let fileName = null
|
let fileName = null
|
||||||
|
@ -80,6 +85,9 @@
|
||||||
schema = fetchSchema(tableId)
|
schema = fetchSchema(tableId)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$: table = $tables.list.find(table => table._id === tableId)
|
||||||
|
$: datasource = $datasources.list.find(ds => ds._id === table?.sourceId)
|
||||||
|
|
||||||
async function fetchSchema(tableId) {
|
async function fetchSchema(tableId) {
|
||||||
try {
|
try {
|
||||||
const definition = await API.fetchTableDefinition(tableId)
|
const definition = await API.fetchTableDefinition(tableId)
|
||||||
|
@ -186,12 +194,15 @@
|
||||||
{/each}
|
{/each}
|
||||||
</div>
|
</div>
|
||||||
<br />
|
<br />
|
||||||
<Toggle
|
<!-- SQL Server doesn't yet support overwriting rows by existing keys -->
|
||||||
bind:value={updateExistingRows}
|
{#if datasource?.source !== SourceName.SQL_SERVER}
|
||||||
on:change={() => (identifierFields = [])}
|
<Toggle
|
||||||
thin
|
bind:value={updateExistingRows}
|
||||||
text="Update existing rows"
|
on:change={() => (identifierFields = [])}
|
||||||
/>
|
thin
|
||||||
|
text="Update existing rows"
|
||||||
|
/>
|
||||||
|
{/if}
|
||||||
{#if updateExistingRows}
|
{#if updateExistingRows}
|
||||||
{#if tableType === DB_TYPE_INTERNAL}
|
{#if tableType === DB_TYPE_INTERNAL}
|
||||||
<Multiselect
|
<Multiselect
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
FROM mcr.microsoft.com/mssql/server:2017-latest
|
FROM mcr.microsoft.com/mssql/server:2022-latest
|
||||||
|
|
||||||
ENV ACCEPT_EULA=Y
|
ENV ACCEPT_EULA=Y
|
||||||
ENV SA_PASSWORD=Passw0rd
|
ENV SA_PASSWORD=Passw0rd
|
||||||
|
|
|
@ -16,7 +16,7 @@ import {
|
||||||
import sdk from "../../../sdk"
|
import sdk from "../../../sdk"
|
||||||
import { builderSocket } from "../../../websockets"
|
import { builderSocket } from "../../../websockets"
|
||||||
import { inputProcessing } from "../../../utilities/rowProcessor"
|
import { inputProcessing } from "../../../utilities/rowProcessor"
|
||||||
import _ from "lodash"
|
import { isEqual } from "lodash"
|
||||||
|
|
||||||
function getDatasourceId(table: Table) {
|
function getDatasourceId(table: Table) {
|
||||||
if (!table) {
|
if (!table) {
|
||||||
|
@ -89,7 +89,7 @@ export async function bulkImport(
|
||||||
if (
|
if (
|
||||||
identifierFields &&
|
identifierFields &&
|
||||||
identifierFields.length > 0 &&
|
identifierFields.length > 0 &&
|
||||||
!_.isEqual(identifierFields, table.primary)
|
!isEqual(identifierFields, table.primary)
|
||||||
) {
|
) {
|
||||||
// This is becuse we make use of the ON CONFLICT functionality in SQL
|
// This is becuse we make use of the ON CONFLICT functionality in SQL
|
||||||
// databases, which only triggers when there's a conflict against a unique
|
// databases, which only triggers when there's a conflict against a unique
|
||||||
|
|
Loading…
Reference in New Issue