mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 02:50:46 -06:00
Add a new dropdown box to the Import CSV dialog to set an ON CONFLICT strategy when importing into an existing table. You can now choose between the old and still default behaviour of aborting the import in case of a conflict, ignoring the conflicting row from the CSV file, and replacing the existing row in the table. See issue #1585.
731 lines
19 KiB
XML
731 lines
19 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<ui version="4.0">
|
|
<class>ImportCsvDialog</class>
|
|
<widget class="QDialog" name="ImportCsvDialog">
|
|
<property name="geometry">
|
|
<rect>
|
|
<x>0</x>
|
|
<y>0</y>
|
|
<width>788</width>
|
|
<height>717</height>
|
|
</rect>
|
|
</property>
|
|
<property name="windowTitle">
|
|
<string>Import CSV file</string>
|
|
</property>
|
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
|
<item>
|
|
<layout class="QFormLayout" name="formLayout">
|
|
<property name="fieldGrowthPolicy">
|
|
<enum>QFormLayout::ExpandingFieldsGrow</enum>
|
|
</property>
|
|
<item row="0" column="0">
|
|
<widget class="QLabel" name="labelName">
|
|
<property name="text">
|
|
<string>Table na&me</string>
|
|
</property>
|
|
<property name="buddy">
|
|
<cstring>editName</cstring>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item row="0" column="1">
|
|
<widget class="QLineEdit" name="editName"/>
|
|
</item>
|
|
<item row="1" column="0">
|
|
<widget class="QLabel" name="labelHeader">
|
|
<property name="text">
|
|
<string>&Column names in first line</string>
|
|
</property>
|
|
<property name="buddy">
|
|
<cstring>checkboxHeader</cstring>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item row="1" column="1">
|
|
<widget class="QCheckBox" name="checkboxHeader">
|
|
<property name="text">
|
|
<string/>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item row="2" column="0">
|
|
<widget class="QLabel" name="labelSeparator">
|
|
<property name="text">
|
|
<string>Field &separator</string>
|
|
</property>
|
|
<property name="buddy">
|
|
<cstring>comboSeparator</cstring>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item row="2" column="1">
|
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
|
<item>
|
|
<widget class="QComboBox" name="comboSeparator">
|
|
<item>
|
|
<property name="text">
|
|
<string>,</string>
|
|
</property>
|
|
</item>
|
|
<item>
|
|
<property name="text">
|
|
<string>;</string>
|
|
</property>
|
|
</item>
|
|
<item>
|
|
<property name="text">
|
|
<string>Tab</string>
|
|
</property>
|
|
</item>
|
|
<item>
|
|
<property name="text">
|
|
<string>|</string>
|
|
</property>
|
|
</item>
|
|
<item>
|
|
<property name="text">
|
|
<string>Other</string>
|
|
</property>
|
|
</item>
|
|
</widget>
|
|
</item>
|
|
<item>
|
|
<widget class="QLineEdit" name="editCustomSeparator">
|
|
<property name="maxLength">
|
|
<number>1</number>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item>
|
|
<spacer name="horizontalSpacer">
|
|
<property name="orientation">
|
|
<enum>Qt::Horizontal</enum>
|
|
</property>
|
|
<property name="sizeHint" stdset="0">
|
|
<size>
|
|
<width>40</width>
|
|
<height>20</height>
|
|
</size>
|
|
</property>
|
|
</spacer>
|
|
</item>
|
|
</layout>
|
|
</item>
|
|
<item row="3" column="0">
|
|
<widget class="QLabel" name="labelQuote">
|
|
<property name="text">
|
|
<string>&Quote character</string>
|
|
</property>
|
|
<property name="buddy">
|
|
<cstring>comboQuote</cstring>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item row="3" column="1">
|
|
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
|
<item>
|
|
<widget class="QComboBox" name="comboQuote">
|
|
<item>
|
|
<property name="text">
|
|
<string>"</string>
|
|
</property>
|
|
</item>
|
|
<item>
|
|
<property name="text">
|
|
<string>'</string>
|
|
</property>
|
|
</item>
|
|
<item>
|
|
<property name="text">
|
|
<string/>
|
|
</property>
|
|
</item>
|
|
<item>
|
|
<property name="text">
|
|
<string>Other</string>
|
|
</property>
|
|
</item>
|
|
</widget>
|
|
</item>
|
|
<item>
|
|
<widget class="QLineEdit" name="editCustomQuote">
|
|
<property name="maxLength">
|
|
<number>1</number>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item>
|
|
<spacer name="horizontalSpacer_2">
|
|
<property name="orientation">
|
|
<enum>Qt::Horizontal</enum>
|
|
</property>
|
|
<property name="sizeHint" stdset="0">
|
|
<size>
|
|
<width>40</width>
|
|
<height>20</height>
|
|
</size>
|
|
</property>
|
|
</spacer>
|
|
</item>
|
|
</layout>
|
|
</item>
|
|
<item row="4" column="0">
|
|
<widget class="QLabel" name="labelEncoding">
|
|
<property name="text">
|
|
<string>&Encoding</string>
|
|
</property>
|
|
<property name="buddy">
|
|
<cstring>comboEncoding</cstring>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item row="4" column="1">
|
|
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
|
<item>
|
|
<widget class="QComboBox" name="comboEncoding">
|
|
<item>
|
|
<property name="text">
|
|
<string>UTF-8</string>
|
|
</property>
|
|
</item>
|
|
<item>
|
|
<property name="text">
|
|
<string>UTF-16</string>
|
|
</property>
|
|
</item>
|
|
<item>
|
|
<property name="text">
|
|
<string>ISO-8859-1</string>
|
|
</property>
|
|
</item>
|
|
<item>
|
|
<property name="text">
|
|
<string>Other</string>
|
|
</property>
|
|
</item>
|
|
</widget>
|
|
</item>
|
|
<item>
|
|
<widget class="QLineEdit" name="editCustomEncoding"/>
|
|
</item>
|
|
<item>
|
|
<spacer name="horizontalSpacer_3">
|
|
<property name="orientation">
|
|
<enum>Qt::Horizontal</enum>
|
|
</property>
|
|
<property name="sizeHint" stdset="0">
|
|
<size>
|
|
<width>40</width>
|
|
<height>20</height>
|
|
</size>
|
|
</property>
|
|
</spacer>
|
|
</item>
|
|
</layout>
|
|
</item>
|
|
<item row="5" column="0">
|
|
<widget class="QLabel" name="labelTrim">
|
|
<property name="text">
|
|
<string>Trim fields?</string>
|
|
</property>
|
|
<property name="buddy">
|
|
<cstring>checkBoxTrimFields</cstring>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item row="5" column="1">
|
|
<widget class="QCheckBox" name="checkBoxTrimFields">
|
|
<property name="text">
|
|
<string/>
|
|
</property>
|
|
<property name="checked">
|
|
<bool>true</bool>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item row="6" column="0">
|
|
<widget class="QLabel" name="separateTables">
|
|
<property name="text">
|
|
<string>Separate tables</string>
|
|
</property>
|
|
<property name="buddy">
|
|
<cstring>checkBoxSeparateTables</cstring>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item row="6" column="1">
|
|
<widget class="QCheckBox" name="checkBoxSeparateTables">
|
|
<property name="text">
|
|
<string/>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item row="7" column="1">
|
|
<widget class="QPushButton" name="buttonAdvanced">
|
|
<property name="text">
|
|
<string>Advanced</string>
|
|
</property>
|
|
<property name="icon">
|
|
<iconset resource="icons/icons.qrc">
|
|
<normaloff>:/icons/down</normaloff>:/icons/down</iconset>
|
|
</property>
|
|
<property name="checkable">
|
|
<bool>true</bool>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item row="9" column="1">
|
|
<widget class="QCheckBox" name="checkIgnoreDefaults">
|
|
<property name="toolTip">
|
|
<string>When importing an empty value from the CSV file into an existing table with a default value for this column, that default value is inserted. Activate this option to insert an empty value instead.</string>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item row="9" column="0">
|
|
<widget class="QLabel" name="labelIgnoreDefaults">
|
|
<property name="text">
|
|
<string>Ignore default &values</string>
|
|
</property>
|
|
<property name="buddy">
|
|
<cstring>checkIgnoreDefaults</cstring>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item row="11" column="1">
|
|
<widget class="QCheckBox" name="checkFailOnMissing">
|
|
<property name="toolTip">
|
|
<string>Activate this option to stop the import when trying to import an empty value into a NOT NULL column without a default value.</string>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item row="11" column="0">
|
|
<widget class="QLabel" name="labelFailOnMissing">
|
|
<property name="text">
|
|
<string>Fail on missing values </string>
|
|
</property>
|
|
<property name="buddy">
|
|
<cstring>checkFailOnMissing</cstring>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item row="8" column="0">
|
|
<widget class="QLabel" name="labelNoTypeDetection">
|
|
<property name="text">
|
|
<string>Disable data type detection</string>
|
|
</property>
|
|
<property name="buddy">
|
|
<cstring>checkNoTypeDetection</cstring>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item row="8" column="1">
|
|
<widget class="QCheckBox" name="checkNoTypeDetection">
|
|
<property name="toolTip">
|
|
<string>Disable the automatic data type detection when creating a new table.</string>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item row="12" column="1">
|
|
<widget class="QComboBox" name="comboOnConflictStrategy">
|
|
<property name="toolTip">
|
|
<string>When importing into an existing table with a primary key, unique constraints or a unique index there is a chance for a conflict. This option allows you to select a strategy for that case: By default the import is aborted and rolled back but you can also choose to ignore and not import conflicting rows or to replace the existing row in the table.</string>
|
|
</property>
|
|
<item>
|
|
<property name="text">
|
|
<string>Abort import</string>
|
|
</property>
|
|
</item>
|
|
<item>
|
|
<property name="text">
|
|
<string>Ignore row</string>
|
|
</property>
|
|
</item>
|
|
<item>
|
|
<property name="text">
|
|
<string>Replace existing row</string>
|
|
</property>
|
|
</item>
|
|
</widget>
|
|
</item>
|
|
<item row="12" column="0">
|
|
<widget class="QLabel" name="labelOnConflictStrategy">
|
|
<property name="text">
|
|
<string>Conflict strategy</string>
|
|
</property>
|
|
<property name="buddy">
|
|
<cstring>comboOnConflictStrategy</cstring>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
</layout>
|
|
</item>
|
|
<item>
|
|
<widget class="QSplitter" name="splitter">
|
|
<property name="orientation">
|
|
<enum>Qt::Vertical</enum>
|
|
</property>
|
|
<property name="childrenCollapsible">
|
|
<bool>false</bool>
|
|
</property>
|
|
<widget class="QWidget" name="filePickerBlock" native="true">
|
|
<property name="enabled">
|
|
<bool>true</bool>
|
|
</property>
|
|
<layout class="QHBoxLayout" name="filePickerLayout">
|
|
<property name="leftMargin">
|
|
<number>0</number>
|
|
</property>
|
|
<property name="topMargin">
|
|
<number>0</number>
|
|
</property>
|
|
<property name="rightMargin">
|
|
<number>0</number>
|
|
</property>
|
|
<property name="bottomMargin">
|
|
<number>0</number>
|
|
</property>
|
|
<item>
|
|
<widget class="QListWidget" name="filePicker"/>
|
|
</item>
|
|
<item>
|
|
<layout class="QVBoxLayout" name="verticalLayout">
|
|
<property name="spacing">
|
|
<number>7</number>
|
|
</property>
|
|
<property name="sizeConstraint">
|
|
<enum>QLayout::SetDefaultConstraint</enum>
|
|
</property>
|
|
<property name="topMargin">
|
|
<number>0</number>
|
|
</property>
|
|
<item>
|
|
<widget class="QPushButton" name="toggleSelected">
|
|
<property name="text">
|
|
<string>Deselect All</string>
|
|
</property>
|
|
<property name="checkable">
|
|
<bool>true</bool>
|
|
</property>
|
|
<property name="checked">
|
|
<bool>true</bool>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item>
|
|
<widget class="QPushButton" name="matchSimilar">
|
|
<property name="enabled">
|
|
<bool>false</bool>
|
|
</property>
|
|
<property name="text">
|
|
<string>Match Similar</string>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
<item>
|
|
<spacer name="verticalSpacer">
|
|
<property name="orientation">
|
|
<enum>Qt::Vertical</enum>
|
|
</property>
|
|
<property name="sizeHint" stdset="0">
|
|
<size>
|
|
<width>20</width>
|
|
<height>40</height>
|
|
</size>
|
|
</property>
|
|
</spacer>
|
|
</item>
|
|
</layout>
|
|
</item>
|
|
</layout>
|
|
</widget>
|
|
<widget class="QTableWidget" name="tablePreview"/>
|
|
</widget>
|
|
</item>
|
|
<item>
|
|
<widget class="QDialogButtonBox" name="buttonBox">
|
|
<property name="orientation">
|
|
<enum>Qt::Horizontal</enum>
|
|
</property>
|
|
<property name="standardButtons">
|
|
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
|
</property>
|
|
</widget>
|
|
</item>
|
|
</layout>
|
|
</widget>
|
|
<tabstops>
|
|
<tabstop>editName</tabstop>
|
|
<tabstop>checkboxHeader</tabstop>
|
|
<tabstop>comboSeparator</tabstop>
|
|
<tabstop>editCustomSeparator</tabstop>
|
|
<tabstop>comboQuote</tabstop>
|
|
<tabstop>editCustomQuote</tabstop>
|
|
<tabstop>comboEncoding</tabstop>
|
|
<tabstop>editCustomEncoding</tabstop>
|
|
<tabstop>checkBoxTrimFields</tabstop>
|
|
<tabstop>checkBoxSeparateTables</tabstop>
|
|
<tabstop>buttonAdvanced</tabstop>
|
|
<tabstop>checkIgnoreDefaults</tabstop>
|
|
<tabstop>checkNoTypeDetection</tabstop>
|
|
<tabstop>checkFailOnMissing</tabstop>
|
|
<tabstop>comboOnConflictStrategy</tabstop>
|
|
<tabstop>filePicker</tabstop>
|
|
<tabstop>toggleSelected</tabstop>
|
|
<tabstop>matchSimilar</tabstop>
|
|
<tabstop>tablePreview</tabstop>
|
|
</tabstops>
|
|
<resources>
|
|
<include location="icons/icons.qrc"/>
|
|
</resources>
|
|
<connections>
|
|
<connection>
|
|
<sender>comboSeparator</sender>
|
|
<signal>currentIndexChanged(int)</signal>
|
|
<receiver>ImportCsvDialog</receiver>
|
|
<slot>updatePreview()</slot>
|
|
<hints>
|
|
<hint type="sourcelabel">
|
|
<x>245</x>
|
|
<y>92</y>
|
|
</hint>
|
|
<hint type="destinationlabel">
|
|
<x>445</x>
|
|
<y>64</y>
|
|
</hint>
|
|
</hints>
|
|
</connection>
|
|
<connection>
|
|
<sender>editName</sender>
|
|
<signal>textChanged(QString)</signal>
|
|
<receiver>ImportCsvDialog</receiver>
|
|
<slot>checkInput()</slot>
|
|
<hints>
|
|
<hint type="sourcelabel">
|
|
<x>609</x>
|
|
<y>13</y>
|
|
</hint>
|
|
<hint type="destinationlabel">
|
|
<x>631</x>
|
|
<y>45</y>
|
|
</hint>
|
|
</hints>
|
|
</connection>
|
|
<connection>
|
|
<sender>editCustomSeparator</sender>
|
|
<signal>textChanged(QString)</signal>
|
|
<receiver>ImportCsvDialog</receiver>
|
|
<slot>updatePreview()</slot>
|
|
<hints>
|
|
<hint type="sourcelabel">
|
|
<x>511</x>
|
|
<y>92</y>
|
|
</hint>
|
|
<hint type="destinationlabel">
|
|
<x>577</x>
|
|
<y>76</y>
|
|
</hint>
|
|
</hints>
|
|
</connection>
|
|
<connection>
|
|
<sender>editCustomQuote</sender>
|
|
<signal>textChanged(QString)</signal>
|
|
<receiver>ImportCsvDialog</receiver>
|
|
<slot>updatePreview()</slot>
|
|
<hints>
|
|
<hint type="sourcelabel">
|
|
<x>511</x>
|
|
<y>126</y>
|
|
</hint>
|
|
<hint type="destinationlabel">
|
|
<x>530</x>
|
|
<y>90</y>
|
|
</hint>
|
|
</hints>
|
|
</connection>
|
|
<connection>
|
|
<sender>editCustomEncoding</sender>
|
|
<signal>textChanged(QString)</signal>
|
|
<receiver>ImportCsvDialog</receiver>
|
|
<slot>updatePreview()</slot>
|
|
<hints>
|
|
<hint type="sourcelabel">
|
|
<x>524</x>
|
|
<y>160</y>
|
|
</hint>
|
|
<hint type="destinationlabel">
|
|
<x>540</x>
|
|
<y>133</y>
|
|
</hint>
|
|
</hints>
|
|
</connection>
|
|
<connection>
|
|
<sender>checkBoxTrimFields</sender>
|
|
<signal>toggled(bool)</signal>
|
|
<receiver>ImportCsvDialog</receiver>
|
|
<slot>updatePreview()</slot>
|
|
<hints>
|
|
<hint type="sourcelabel">
|
|
<x>192</x>
|
|
<y>182</y>
|
|
</hint>
|
|
<hint type="destinationlabel">
|
|
<x>368</x>
|
|
<y>244</y>
|
|
</hint>
|
|
</hints>
|
|
</connection>
|
|
<connection>
|
|
<sender>comboEncoding</sender>
|
|
<signal>currentIndexChanged(int)</signal>
|
|
<receiver>ImportCsvDialog</receiver>
|
|
<slot>updatePreview()</slot>
|
|
<hints>
|
|
<hint type="sourcelabel">
|
|
<x>271</x>
|
|
<y>160</y>
|
|
</hint>
|
|
<hint type="destinationlabel">
|
|
<x>572</x>
|
|
<y>121</y>
|
|
</hint>
|
|
</hints>
|
|
</connection>
|
|
<connection>
|
|
<sender>checkboxHeader</sender>
|
|
<signal>toggled(bool)</signal>
|
|
<receiver>ImportCsvDialog</receiver>
|
|
<slot>updatePreview()</slot>
|
|
<hints>
|
|
<hint type="sourcelabel">
|
|
<x>192</x>
|
|
<y>56</y>
|
|
</hint>
|
|
<hint type="destinationlabel">
|
|
<x>354</x>
|
|
<y>45</y>
|
|
</hint>
|
|
</hints>
|
|
</connection>
|
|
<connection>
|
|
<sender>toggleSelected</sender>
|
|
<signal>toggled(bool)</signal>
|
|
<receiver>ImportCsvDialog</receiver>
|
|
<slot>updateSelection(bool)</slot>
|
|
<hints>
|
|
<hint type="sourcelabel">
|
|
<x>777</x>
|
|
<y>385</y>
|
|
</hint>
|
|
<hint type="destinationlabel">
|
|
<x>368</x>
|
|
<y>244</y>
|
|
</hint>
|
|
</hints>
|
|
</connection>
|
|
<connection>
|
|
<sender>comboQuote</sender>
|
|
<signal>currentIndexChanged(int)</signal>
|
|
<receiver>ImportCsvDialog</receiver>
|
|
<slot>updatePreview()</slot>
|
|
<hints>
|
|
<hint type="sourcelabel">
|
|
<x>245</x>
|
|
<y>126</y>
|
|
</hint>
|
|
<hint type="destinationlabel">
|
|
<x>350</x>
|
|
<y>88</y>
|
|
</hint>
|
|
</hints>
|
|
</connection>
|
|
<connection>
|
|
<sender>buttonBox</sender>
|
|
<signal>accepted()</signal>
|
|
<receiver>ImportCsvDialog</receiver>
|
|
<slot>accept()</slot>
|
|
<hints>
|
|
<hint type="sourcelabel">
|
|
<x>281</x>
|
|
<y>707</y>
|
|
</hint>
|
|
<hint type="destinationlabel">
|
|
<x>157</x>
|
|
<y>274</y>
|
|
</hint>
|
|
</hints>
|
|
</connection>
|
|
<connection>
|
|
<sender>buttonBox</sender>
|
|
<signal>rejected()</signal>
|
|
<receiver>ImportCsvDialog</receiver>
|
|
<slot>reject()</slot>
|
|
<hints>
|
|
<hint type="sourcelabel">
|
|
<x>349</x>
|
|
<y>707</y>
|
|
</hint>
|
|
<hint type="destinationlabel">
|
|
<x>286</x>
|
|
<y>274</y>
|
|
</hint>
|
|
</hints>
|
|
</connection>
|
|
<connection>
|
|
<sender>checkBoxSeparateTables</sender>
|
|
<signal>toggled(bool)</signal>
|
|
<receiver>ImportCsvDialog</receiver>
|
|
<slot>checkInput()</slot>
|
|
<hints>
|
|
<hint type="sourcelabel">
|
|
<x>192</x>
|
|
<y>206</y>
|
|
</hint>
|
|
<hint type="destinationlabel">
|
|
<x>368</x>
|
|
<y>244</y>
|
|
</hint>
|
|
</hints>
|
|
</connection>
|
|
<connection>
|
|
<sender>matchSimilar</sender>
|
|
<signal>pressed()</signal>
|
|
<receiver>ImportCsvDialog</receiver>
|
|
<slot>matchSimilar()</slot>
|
|
<hints>
|
|
<hint type="sourcelabel">
|
|
<x>777</x>
|
|
<y>418</y>
|
|
</hint>
|
|
<hint type="destinationlabel">
|
|
<x>368</x>
|
|
<y>244</y>
|
|
</hint>
|
|
</hints>
|
|
</connection>
|
|
<connection>
|
|
<sender>buttonAdvanced</sender>
|
|
<signal>toggled(bool)</signal>
|
|
<receiver>ImportCsvDialog</receiver>
|
|
<slot>toggleAdvancedSection(bool)</slot>
|
|
<hints>
|
|
<hint type="sourcelabel">
|
|
<x>265</x>
|
|
<y>241</y>
|
|
</hint>
|
|
<hint type="destinationlabel">
|
|
<x>393</x>
|
|
<y>358</y>
|
|
</hint>
|
|
</hints>
|
|
</connection>
|
|
</connections>
|
|
<slots>
|
|
<slot>updatePreview()</slot>
|
|
<slot>checkInput()</slot>
|
|
<slot>updateSelection(bool)</slot>
|
|
<slot>matchSimilar()</slot>
|
|
<slot>toggleAdvancedSection(bool)</slot>
|
|
</slots>
|
|
</ui>
|