Commit Graph

2441 Commits

Author SHA1 Message Date
Martin Kleusberg
c9d651c7b2 Add value of the case_sensitive_like PRAGMA to the project files
We allow the user to edit the case_senstive_like PRAGMA via the UI. But
because its state is not saved in the database - just like with the
foreign_key PRAGMA - we should save it in the project file for users who
want to restore the entire environment.
2018-08-09 14:04:47 +02:00
Manuel
4f1256cc5f Allow "getting" and setting case_sensitive_like pragma (#1494)
* Allow "getting" and setting case_sensitive_like pragma

In order to allow case insensitive filtering, the pragma
case_sensitive_like is added to the GUI. Given that this pragma cannot be
read, a special SELECT request is made in DBBrowserDB::getPragma for
inferring its value.

See issue #1489.

* Warning in the pragma case_sensitive_like

This pragma has some peculiarities, so it is convenient to warn the user
about it through a tool-tip in the value.
2018-08-09 14:00:21 +02:00
mgrojo
282e6739d9 Prevent data loss when editing table with foreign keys enabled
Our procedure for editing tables may involve a drop of the old table
definition. This will trigger the "ON DELETE CASCADE" clauses of the
child tables, leading to unexpected and silent data loss.

Following the procedure described in:
https://www.sqlite.org/lang_altertable.html
we can guarantee that no data is deleted, but at the cost of opening a
new transaction specific for the table modification. The possible pending
changes must be saved before. This is only done when the foreign_keys
pragma is enabled.

See issue #1481
2018-08-09 13:28:49 +02:00
mgrojo
7b660338ed Standard use of title case and ellipsis in menu actions
Menu actions that take the user to a dialog, where the action is completed
with some interaction and that could be cancelled, now have ellipsis.

Actions that only open an informative window do no longer have ellipsis.

Title case used in all menu entries.

See issue #1434
2018-08-09 12:45:41 +02:00
mgrojo
732c322181 Menu bar restructured so it follows a more standard layout
- Some actions not directly related to file operations over databases or
projects have been moved from "File" to a new "Tools" top-level menu entry.
Future tools can be added here.
- Preferences moved from "View" to "Edit" (MacOS is supposed to still have
it in the application menu).

See issue #1434
2018-08-09 12:45:41 +02:00
Martin Kleusberg
9a30e6cbb0 Don't translate PRAGMAs in the UI editor
This disables translation for PRAGMA names and values in the Edit Pragma
tab. The values must not be translated when using the current
implementation because they are used as shown for reading and writing
the PRAGMA values. The names could be translated but probably should not
be because they are more fixed name than description of their function.

See issue #1489.
2018-08-09 12:35:44 +02:00
Justin Clift
2f1a012933 Removing mailing list entry
The mailing list server will likely be offline for an extended period.
2018-08-08 14:24:09 +01:00
Manuel
d343a55286 Merge pull request #1473 from sqlitebrowser/filter_strings
Support for operator filters for strings
2018-08-08 14:39:02 +02:00
Martin Kleusberg
c46081c137 Fix typo in Readme 2018-08-08 14:01:20 +02:00
mgrojo
636136a775 Use official Qt translation for Shift key
The translation of key sequences must be empty or follow the official Qt
translated names, otherwise the key sequence is not recognised and it will
not work.

The official translation for Shift key is "May" (not "Mayús" or "Mayús.")

See possibly related issue #1491
2018-08-06 21:31:05 +02:00
mgrojo
b6f47f91de Use standard SQL quotes for string literals 2018-08-06 19:46:13 +02:00
mgrojo
f977534a1b Improper use of no-translation (notr) attribute
"Preview only (N/A)" must be translated
"toolBar1" although it's a window title it will never show up, so better
not request translation.
2018-08-06 19:24:46 +02:00
Martin Kleusberg
6db6a4d327 Add link to the Wiki to the Readme file
See issue #1464.
2018-08-05 16:32:54 +02:00
Martin Kleusberg
cdbed71905 Replace Patreon badge in Readme file
Use a shields.io image for the Patreon link for better consistency with
the other badges.
2018-08-05 16:26:26 +02:00
Martin Kleusberg
9a8f223b88 Add support for in-memory databases
Add a new menu option for opening an in-memory database. When working on
an in-memory database some menu options are disabled because they only
make sense when the database is also written to disk. I have left the
Write Changes button enabled though because for some actions the current
transaction needs to be committed - even though it's only committed to
memory then.

See issues #335 and #1492.
2018-08-05 15:45:50 +02:00
Martin Kleusberg
52de8c3099 Fix a crash when opening another database after adding some records
The application crashed for me when I opeend a database, then switched
to Browse Data tab, added some records there, then created a new empty
database.
2018-08-05 15:32:36 +02:00
mgrojo
aa82b52d5c Result of spell checker in Spanish translation
- Spelling errors fixed
- Mayús as proper translation for Shift key
- Fixed misinterpretation of "Displayed text"
2018-08-04 13:57:23 +02:00
mgrojo
2b6f0d7378 Updated and improved Spanish translation
- Translation for last developments
- Consistency of translated terms
- Do not translate part of the application name
- New spelling rule for 'solo'
2018-08-04 12:34:10 +02:00
mgrojo
d65427a8a6 Fixes and improvements in user messages
- Title for the File Extension Manager
- Independent messages for each object type. See issue #1490
- Fixed incorrect wording in "What's This" message
2018-08-03 18:49:25 +02:00
mgrojo
241372e6eb Improvements for the "Unlock view editing" feature
Provide a combo box for selecting the field from the list of fields in the
view.

Uncheck the menu option when the user cancels the action.

Escape the primary key in the UPDATE statements since it is not always
rowid (views, without rowid tables) and consequently the name might needed
it.
2018-07-29 18:18:19 +02:00
mgrojo
2701223aac Crash when browsing a table, deleting it and back to the data browser
Following these steps a crash was observed:
1. Browse a Table T in "Browse Data" tab
2. Change to "Database Structure" tab and delete table T
3. Return to "Browse Data" tab

The application crashed because the combo still had the deleted table
value. It was too soon for the updateInsertDeleteRecordButton() call.
Moving it to the end of the method solves the issue.
2018-07-29 14:27:28 +02:00
mgrojo
e1ef492d78 Issue #1484 & #1480: crash when closing a DB having scrolled a table
Following a series of signals after closing the DB the application reaches
SqliteTableModel::isEditable() which isn't prepared for closed databases.
Taking this into account fixes the crash.

This crash seems to have being introduced in 3da520cdd1
2018-07-28 14:34:08 +02:00
mgrojo
01bf059270 Fix style consistency and translation problems with "Delete record" label
In 5fbf5ca1b2 the label of the "Delete
Record" was inadvertently changed to "Delete record". The label is reverted
to the old style for consistency and for restoring coherence of the
translations.

The new Polish translation is changed accordingly.

See issue #1480.
2018-07-20 19:11:44 +02:00
mgrojo
d50a27ab6e Use exact filter when jumping to referenced row
Ctrl+Shift+Click jumps from a foreign key cell to its referenced row in the
other table. It is only exactly one row if we filter for equality. It will
be also faster.
2018-07-17 23:25:57 +02:00
Martin Kleusberg
7a9f310778 Don't allow editing the SQL preview in the Edit Index dialog
Don't allow the user to edit the SQL preview in the Edit Index dialog
because it's just supposed to be a preview.
2018-07-15 23:39:40 +02:00
Justin Clift
1b7ba4a7e7 Update Qt path for build server to use Qt 5.8 2018-07-15 17:33:10 +01:00
Justin Clift
eccc6f269c Update Qt path for build server to use Qt 5.9.6 2018-07-15 12:29:19 +01:00
Martin Kleusberg
fdc0a6a514 Fix code to determine the total row number before a SQL dump
Before running the actual SQL dump we need to determine the total number
of rows in the database in order to show a progress bar. This code
didn't work as expected since the multithreading changes. On the one
hand it would produce occasional error messages in the console and maybe
even crash. On the other hand the resulting value would always be zero
which in turn leads to the progress bar not working. Both issues are
fixed by rewriting the code here.

See issue #1476.
2018-07-14 19:12:15 +02:00
Martin Kleusberg
9d4c20e603 Try to fix building the tests on older Qt versions 2018-07-14 15:55:49 +02:00
Martin Kleusberg
dbd2d648d8 tests: Better error messages
Show better error messages for failing tests.
2018-07-13 17:05:54 +02:00
Martin Kleusberg
c150d1a766 grammar: Fix row value parsing, improve whitespace handling, fix tests
This commit fixes a regression which was introduced in commit
788134eee6 which broke the parsing of row
values.

It also makes sure CHECK expressions are parsed in exactly the same way,
no matter whether they are a column or a table constraint. Before spaces
were added to the query in a different way. The way it was done for
column constaints had also an error were the minus sign of a negative
number was separated from the first digit by a space. This is fixed,
too.

Because of all the changes this commit also adjusts the tests to expect
the new layout of the check expressions. It also adds some new tests for
row values and for complex expressions to make sure both work. Finally,
it also removes all QScintilla dependencies from the tests which don't
seem to be necessary.
2018-07-13 16:54:43 +02:00
Justin Clift
67d14d5c5e Update Win64 Qt path for the build server.
Forgot about this path yesterday, so the .msi file creation failed
overnight.
2018-07-13 11:59:00 +01:00
Marc Campbell
3008747ada Add '.db3' and '.sqlite3' file extensions to macOS file associations 2018-07-13 10:20:58 +01:00
Marc Campbell
28f6c6e6c1 Add '.sqlite' file extension to macOS file associations 2018-07-13 00:52:13 +01:00
Justin Clift
9a76537aa4 Fix Win compile failure
* Revert c861f1b9d9, as it's breaking
  the MSVC 2013 compile.
* Move the new OUTPUT_NAME line slightly, so it's recognised
2018-07-13 00:46:14 +01:00
mgrojo
b37df2cf62 Only enable filter actions when Extended Table has filter lines
When the filter lines have not been generated for a Extended Table
(currently the case for Execute SQL tables), the filter actions make no
sense, so they are disabled.

See issue #1469
2018-07-13 00:25:11 +02:00
Justin Clift
6a2c4511f1 Update Win x64 Qt path for our build server 2018-07-12 22:28:16 +01:00
mgrojo
4c9f55660b Support for operator filters for strings
This adds support for all operators when applied to string values.
Formerly they were always treated as a Containing (LIKE) operator, but
after the implementation of bbe2e33ea4 the
lack of these operators were more visible and, at least, the omission of
<> seems a bug. But the omission of the others may also be a limitation.

For easing the return to the old behaviour, the Containing filter option
now takes into account the necessity of escaping the value when it starts
by one of the operator characters.

For operators applied to strings the behaviour is documented by Sqlite3
here: https://www.sqlite.org/datatype3.html#collating_sequences

See related issue #1463.
2018-07-12 22:48:49 +02:00
Martin Kleusberg
aef3b6b0cc Rework execution logic in Execute SQL tab
This commit changes the execution logic in the Execute SQL tab. Before
this we were trying to first get the exact part of the SQL text to
execute and then execute it without further checking. After this we're
only trying to find an exact start position for the SQL text to execute
while the end position is only a rough estimate. This way the exact end
position can be determined by SQLite.

This fixes issue #1470.

It also cleans up the code a bit and (hopefully) makes it a bit easier
to read.
2018-07-12 22:24:42 +02:00
Martin Kleusberg
5a339ea9d0 Fix cmake build on Windows
See issue #1471.
2018-07-12 20:44:02 +02:00
Manuel
96e44b9957 Merge pull request #1455 from sqlitebrowser/execute_sql_issues
User SQL log with results and other fixes and improvements in Execute SQL
2018-07-11 21:48:45 +02:00
mgrojo
606ec09b61 PR #1455: implement @MKleusberg's suggested changes
- The start and index is only manipulated for the special case of the
start position being at the end of a line (typical when the sentences begin
at the first column. This gives accurate results for both error indicators
and line references in log.

- Tab name in execution titles.

- 'IN' in titles instead of 'AT'.
2018-07-11 21:22:07 +02:00
Martin Kleusberg
22ac0dcef1 Add flag for the Polish translation
See issue #1456.
2018-07-10 23:14:27 +02:00
Marcin Mikołajczak
44920ce098 i18n: Add Polish translation (#1456)
Signed-off-by: Marcin Mikołajczak <me@m4sk.in>
2018-07-10 23:12:28 +02:00
Martin Kleusberg
788134eee6 grammar: Fix parsing of complex expression
This fixes parsing of expressions of the form '(x) AND/OR y' and similar
types. It also fixes expression of the '(x)' type and of the '(x op y
AND z op w)' type.

See issue #1454.
2018-07-10 23:07:38 +02:00
Iulian Onofrei
961141ec36 Replace deprecated qt5_use_modules function (#1419)
* Replace deprecated qt5_use_modules function

* Fix includes that fall under a larger module

* Bump minimum Cmake version to use newer features and properly use libs

* Replace deprecated qt5_use_modules function and bump minimum CMake version to 3.1.0 for 3rd party libraries
2018-07-10 20:57:55 +02:00
Iulian Onofrei
3cdc65a63f Add automatic crypted databases open via dotenvs (#1404)
* Rename confusing variables

* Fix some project warnings

* Fix code style

* Add constant for the default page size

* Move KeyFormats enum to CipherSettings

* Fix code style

* Fix memory leak

* Stop relying on CipherDialog for encryption settings management

* Fix code style

* Add .env format for QSettings

* Add automatic crypted databases open via dotenvs

This adds support for `.env` files next to the crypted databases that
are to be opened that contains the needed cipher settings.

The only required one is the plain-text password as a value for the key
with the name of the database like this:

    myCryptedDatabase.sqlite = MyPassword

This way, databases with a different extension are supported too:

    myCryptedDatabase.db = MyPassword

You can also specify a custom page size adding a different line
(anywhere in the file) like this:

    myCryptedDatabase.db_pageSize = 2048

If not specified, `1024` is used.

You can also specify the format of the specified key using the
associated integer id:

    anotherCryptedDatabase.sqlite = 0xCAFEBABE
    anotherCryptedDatabase.sqlite_keyFormat = 1

where `1` means a Raw key. If not specified, `0` is used, which means a
simple text Passphrase.

Dotenv files (`.env`) are already used on other platforms and by
different tools to manage environment variables, and it's recommended
to be ignored from version control systems, so they won't leak.

* Add new files to CMakeLists

* Move DotenvFormat include to the implementation

* Fix build error

* Remove superfluous method

(related to ac51c23)

* Remove superfluous checks

* Fix memory leaks

(introduced by 94bbb46)

* Fix code style

* Make dotenv related variable and comment clearer

* Remove duplicated code

* Remove unused forward declaration

(introduced by e5a0293)
2018-07-10 20:46:17 +02:00
Martin Kleusberg
c861f1b9d9 Silence a clang warning 2018-07-10 20:39:50 +02:00
mgrojo
bbe2e33ea4 Issue #1463: give assistance to users in using the filters
Added contextual menus in filter line box and cells for assisting in using
filters and for discovering existing filters.

The menu in the filter line adds "What's This" option and helper options
that add the operator and a selected placeholder (?) for easy editing.
Special options for NULL and empty strings are also added. Those work
directly.

The menu in the cells works as the current "Use as Filter" but for
different operators. In this case, only the range operator is incomplete.

Currently, not all the operators make sense for strings because we take
them as LIKE filters. At least the Not Equal filter (<>) should work, but
the other would also make sense. This will be addressed in future commits.
2018-07-08 14:29:52 +02:00
mgrojo
e0fcbf93ba Issue #1440: added context hints in the identifier quotes options
Give hints to the user about the context where the different quoting
options would be useful.

Declare the Standard SQL option as the recommended setting.
2018-07-08 12:32:12 +02:00