Commit Graph

1926 Commits

Author SHA1 Message Date
Justin Clift 74848d085e Remove AppImage creation from Travis CI, as it's causing Travis to fail 2017-07-21 16:59:57 +01:00
Justin Clift 1dd4d189f0 Add minimum width to the Preferences dialog remote tab panels
Otherwise the display is fairly messed up on OSX
2017-07-21 16:58:41 +01:00
Justin Clift 608b8486c1 Add development Certificate Authoritiy cert chain 2017-07-21 16:57:30 +01:00
Petr Tykal 708c54f1d0 Begin of czech translation 2017-06-30 23:48:38 +02:00
Martin Kleusberg e64eb8a118 Only load extra byte in the CSV parser when there's more data available 2017-06-30 22:32:13 +02:00
Martin Kleusberg 26ddcf2c04 Allow setting PRAGMAs from the Execute SQL tab
As per popular request, this adds support for setting PRAGMAs from the
Execute SQL tab. Since most PRAGMAs won't work inside a transaction we
make sure that we're not in one while the PRAGMA statement is executed.
If this means we need to commit any pending changes, the user get a
message box.

See issues #1021, #980, #966.
2017-06-30 21:59:47 +02:00
Martin Kleusberg c6deca1242 Fix CSV import when line breaks appear at the buffer boundary
We're reading CSV files not all at once but in chunks. And when we're
encountering a \r char we're checking if it is followed by a \n char. So
far so good. But now it might happen that we're hitting a \r char that's
right at the end of the current buffer. In this case the lookahead check
isn't working as expected because there isn't more data available yet.
This commit fixes the issue by checking for these conditions and loading
an extra byte when needed.

See issue #1033.
2017-06-30 00:59:03 +02:00
Martin Kleusberg abd7d4e689 When importing CSV data into existing tables, don't insert empty strings
When importing a CSV file into an existing table (i.e. a table where we
have a table schema), check the data type of a field before inserting
empty values. If it is an integer field, don't insert empty string like
we did before but 0 or NULL depending on the NOT NULL flag.

See issue #195.

Please note that this isn't perfect. The preview in the dialog doesn't
reflect these changes yet, it just show you the contents of the file as
is. It's a little tricky to change this and I somehow think it's better
the way it is now anyway. Also the import doesn't check for other
constraints like UNIQUE or CHECK which might cause trouble. But then
again it didn't do that before either.
2017-06-29 22:22:57 +02:00
Martin Kleusberg 08f15b3bf1 Enforce quote chars in CSV export for fields with line breaks
See issue #1037.
2017-06-29 21:08:37 +02:00
Martin Kleusberg a92a32157a Fix two problems in the CSV import
When importing a CSV file and using the first row as the field names,
the row would be imported as the first data row again. It's now skipped
when the checkbox is set.

When importing a single CSV file the checkbox asking whether to import
into a single table or separate tables is hidden. However, the last set
values are loaded anyway when the dialog is opened. This means the
checkbox could be set, even though it's invisible. If it's set, however,
and we're importing a single CSV file this would mean that it's
impossible to manually set the table name to import into. This is fixed,
too.

Also this simplifies the code a bit and removed a large loop from the
import dialog code.
2017-06-29 00:19:08 +02:00
Martin Kleusberg e3764c920f Change wording of a message box 2017-06-28 22:45:16 +02:00
Martin Kleusberg 3c40a12103 Rework the Execute SQL tab handling
Allow opening new tabs, opening SQL files, and saving SQL files even
when no database is opened. Execution of SQL statements obviously is
still not allowed. But this should make it possible to use DB4S as a
simple SQL text editor if no better alternative is available on the
system.

Don't close SQL tabs when closing the databse.

When opening a database only close empty tabs, keep all non-empty tabs
opened. This should make sure that no SQL statements are accidentally
lost when opening a new database or simply closing the old one.

When opening a project file, close all tabs and load the new tabs from
the project file.

See issue #1035.
2017-06-28 22:17:38 +02:00
Martin Kleusberg df8219de09 In Edit Index dialog don't remove expression columns by accident
Don't allow removing expression columns by double clicking as this it
too error-prone. Instead require a button click for removal and only
start editing the expression when double clicking.

See issue #1012.
2017-06-28 16:56:26 +02:00
Martin Kleusberg 803a1fa5cb Add 'Set to NULL' context menu action
Add a new action 'Set to NULL' to the table browser context menu for
setting all selected items to NULL.
2017-06-28 16:40:09 +02:00
Martin Kleusberg 2421fef219 Add context menu to all table views
Add a context menu to all table view widgets in the program (Browse Data
tab and Execute SQL tab) which opens when right clicking a table item.

Currently the menu only allows you to copy and paste the selected
item(s).

Only activate the paste action when the current view is writable.
2017-06-28 16:30:03 +02:00
Martin Kleusberg 4de01c1e73 Add helper function to make the code more self-explanatory 2017-06-28 16:29:28 +02:00
Martin Kleusberg 4f676ae206 Check for errors when reading or writing sQL files
See issue #1036.
2017-06-28 15:35:30 +02:00
Martin Kleusberg f4fad4afcf Fix possible crash when loading project files
This fixes a crash when loading project files that haven't set the
current tab to the Browse Data tab.

See issue #1019.
2017-06-26 12:39:50 +02:00
Justin Clift 004f715828 Add qt5-qtbase-devel to the dnf package list for CentOS 7. Thanks @architectcom. :)
As pointed out by @architectcom, CentOS 7 needs qt5-qtbase-devel installed else compiling will fail:

  https://github.com/sqlitebrowser/sqlitebrowser/commit/c74204c7006d9e74921e7ccf5667afda2ce97119#commitcomment-22747681
2017-06-25 12:13:01 +01:00
Martin Kleusberg f1f24be743 Make SQL auto completion case insensitive
See issue #1046.
2017-06-22 19:42:22 +02:00
Martin Kleusberg 6c9c56a2a9 Fix browsing of tables without rowid
Browsing WITHOUT ROWID tables was broken since a couple of commits. An
error message would be printed to the console and all cells would stay
empty. This is fixed by this commit.
2017-06-22 00:05:53 +02:00
Martin Kleusberg 61f385abba Don't crash when pasting data in a view
When pasting data into a cell of a view the application would have
crashed because it treats the view as a table (which it isn't). This is
fixed by this.
2017-06-21 23:25:53 +02:00
Martin Kleusberg 6984d451d6 Properly initialise table browser settings 2017-06-17 13:11:59 +02:00
Martin Kleusberg 157dadef50 Don't SQL export indices or triggers if their base table isn't exported
See issue #1013.
2017-06-17 12:14:57 +02:00
iKlsR 357faeed04 Allow specifying unique table names for separate imports 2017-06-16 17:35:36 +02:00
iKlsR 97b4261190 Cleanup logic, code reuse, faster header picking 2017-06-16 17:35:36 +02:00
iKlsR a588fb83d1 Edit widget tab order 2017-06-16 17:35:36 +02:00
iKlsR b5a2411eb6 Append Separate Tables state to import settings 2017-06-16 17:35:36 +02:00
iKlsR 225eb5ab5f Allow matching similar csv files for batch import 2017-06-16 17:35:36 +02:00
iKlsR b0eb9acae2 Allow for interactive CSV file import
- Tweak input checker
- Preserve old file import as not to cause any unforeseen breaks
- Allow ignoring file name when importing multiple files to tables
- Mass toggle several files for import
2017-06-16 17:35:36 +02:00
iKlsR 7d02ea3a09 Extend FileDialog to accommodate multiple file selection 2017-06-16 17:35:36 +02:00
Martin Kleusberg 8332c39688 Allow changing the page size pragma using the UI
This fixes changing the page size pragma values using the UI editor. You
need to execute the VACUUM statement right after the pragma.

See issue #1021.
2017-06-03 00:50:03 +02:00
Justin Clift ac37fcea31 Merge pull request #1030 from karim/master
Update the latest nightly version link
2017-05-31 23:48:41 +01:00
Karim ElDeeb bdbcfcc197 Update the latest nightly version link
Update the nightly version link to point to the new link instead of the
old one which points to the release build.
2017-06-01 00:26:29 +02:00
Martin Kleusberg 7ad8035261 Keep current sort order after refreshing in Browse Data tab
See issue #1016.
2017-05-19 15:34:53 +02:00
Martin Kleusberg 462c252656 Add selecting fields in Execute SQL tab for Edit Cell dock via keyboard
See issue #481.
2017-05-19 15:13:57 +02:00
Martin Kleusberg b7cd1c7dbd Don't allow setting data for custom query model data
See issue #1015.
2017-05-19 15:04:47 +02:00
Justin Clift 7f3c4f928e Updated README for new "latest" nightly build dir 2017-05-17 15:56:58 +01:00
Martin Kleusberg 8cc3154c72 Add button for adding expression columns in Edit Index dialog
Add a button for adding new expression columns to the Edit Index dialog.

Allow the user to edit the 'name' of existing expression columns in the
Edit Index dialog.
2017-05-14 21:37:11 +02:00
Martin Kleusberg 6321d14dd6 Add buttons for changing the column order in Edit Index dialog
Add two buttons for moving index columns up or down in the Edit Index
dialog.
2017-05-14 20:48:43 +02:00
Martin Kleusberg f06b63bc66 Use savepoint in Edit Index dialog
Create a save point when opening the Edit Index dialog. This allows us
to revert back to the last version when pressing the Cancel button.
2017-05-14 20:48:42 +02:00
Martin Kleusberg e61d7d9fa7 Allow setting the partial index clause in the Edit Index dialog
This adds a new field to the Edit Index dialog that allows the user to
change the partial index expression for an index.

Example:
CREATE INDEX i ON a(
     col1 ASC,
     col2 DESC
) WHERE id < 1000;	-- This bit here
2017-05-14 20:48:42 +02:00
Justin Clift d17b5454a1 Qmake now installs icon and metadata on *nix 2017-05-14 18:12:31 +01:00
Justin Clift 9325762456 Typo fix 2017-05-14 18:11:45 +01:00
Justin Clift 210624353e Added developer mailing list to README.md 2017-05-14 16:33:57 +01:00
Martin Kleusberg 58996f1345 Rework the Edit Index dialog
Change the layout of the dialog entirely. Instead of having checkboxes
that, if activated, move a column into the index, use two separate table
views, one for available columns and one for used columns. This makes it
easier to see the index structure on first sight. It also makes it
possible to see the order of the different index columns from the table
views. Additionally, now expression columns that are used in the index
are shown in the table views, even allowing them to be removed from the
index.
2017-05-14 17:01:00 +02:00
Martin Kleusberg b953edc8eb grammar: Don't produce unnecessary separator char in index SQL 2017-05-14 14:26:13 +02:00
Martin Kleusberg 5d45636b9e export: Support dropping non-table objects in SQL export 2017-05-14 14:11:42 +02:00
Justin Clift a3709576f7 Move back to Qt 5.7 for now 2017-05-14 10:53:03 +01:00
Justin Clift f8d9cc4361 Merge pull request #1011 from karim/master
Add Windows XP support
2017-05-12 17:50:21 +01:00