clickhouse: added specifcNotNull dialect option

This commit is contained in:
Jan Prochazka
2024-09-11 15:41:26 +02:00
parent fb39cd1302
commit f74533b42f
11 changed files with 17 additions and 9 deletions

View File

@@ -31,7 +31,7 @@
return [
{ text: 'Rename column', onClick: handleRenameColumn },
{ text: 'Drop column', onClick: handleDropColumn },
{ text: 'Copy name', onClick: () => navigator.clipboard.writeText(data.columnName)},
{ text: 'Copy name', onClick: () => navigator.clipboard.writeText(data.columnName) },
];
}

View File

@@ -88,9 +88,9 @@
{/if}
<ColumnLabel {...column} />
{#if _.isString(column.dataType) && !order}
{#if _.isString(column.displayedDataType || column.dataType) && !order}
<span class="data-type" title={column.dataType}>
{column.dataType.toLowerCase()}
{(column.displayedDataType || column.dataType).toLowerCase()}
</span>
{/if}
</div>

View File

@@ -196,7 +196,7 @@
<div class="space" />
{#if designer?.style?.showDataType && column?.dataType}
<div class="ml-2">
{column?.dataType.toLowerCase()}
{(column?.displayedDataType || column?.dataType).toLowerCase()}
</div>
{/if}
{#if designer?.style?.showNullability}

View File

@@ -19,6 +19,7 @@
export let columnName = '';
export let extInfo = null;
export let dataType = null;
export let displayedDataType = null;
export let showDataType = false;
export let foreignKey;
export let conid = undefined;
@@ -59,7 +60,7 @@
{/if}
</span>
{:else if dataType}
<span class="extinfo">{dataType.toLowerCase()}</span>
<span class="extinfo">{(displayedDataType || dataType).toLowerCase()}</span>
{/if}
{/if}
</span>

View File

@@ -32,7 +32,9 @@
<FormTextField name="columnName" label="Column name" focused disabled={isReadOnly} />
<DataTypeEditor dialect={driver?.dialect} disabled={isReadOnly} />
<FormCheckboxField name="notNull" label="NOT NULL" disabled={isReadOnly} />
{#if !driver?.dialect?.specificNotNull}
<FormCheckboxField name="notNull" label="NOT NULL" disabled={isReadOnly} />
{/if}
<FormCheckboxField name="isPrimaryKey" label="Is Primary Key" disabled={isReadOnly} />
<FormCheckboxField name="autoIncrement" label="Is Autoincrement" disabled={isReadOnly} />
<FormTextField

View File

@@ -187,7 +187,7 @@
on:clickrow={e => showModal(ColumnEditorModal, { columnInfo: e.detail, tableInfo, setTableInfo, driver })}
onAddNew={isWritable ? addColumn : null}
columns={[
{
!driver?.dialect?.specificNotNull && {
fieldName: 'notNull',
header: 'Nullability',
sortable: true,