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.
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.
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.
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.
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
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.
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.
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.
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.
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
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.
- 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'.
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.
* 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
* 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)
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.
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.
QHexEdit widget was being set disabled instead of read-only, according to
comments, because there wasn't any setReadOnly in qhexedit. At least in
the current version, the method actually exists, so it is now used.
This allows the user to move the scroll and select text in the binary mode
of the 'Edit Database Cell' dock.
- Set the line terminator according to operating system (text and SQL
versions).
- Quote identifiers using the user preference and string literals as 'SQL
standard'.
- Support BLOB literals for any kind of binary data and avoid converting
any kind of image to PNG in the process of setting the BLOB literal in SQL.
As said by the author GortiZ6:
> I've added the ability to copy fields from tables in SQL format.
> I found much robust and easier copy data in SQL from one DB to another so that if the number of columns differs or if I want to build a single SQL file to share several fields from several table with someone I can do it.
This issue was introduced in 211f7341ff
(issue #1306).
browse_table_settings node was not closed, and consequently tab_sql node
was left inside tab_browse but the loading case for tab_sql was still
expecting it outside tab_browse. Since this was an unintended change the
tab_sql node is reverted now to its former location.
This means that all the nightly versions since
211f7341ff until this fix generate project
files with incorrect format and later versions will also not be able to
restore the SQL tabs for those project files unless manually edited.
Nevertheless, the loading code was also broken for tab_sql since there
was an incorrect skipCurrentElement call before getting to the tab_sql tag.
Resize also the Name column in the Dock since it has usually short content
and there is little space there, so it's better to resize it after every
schema population.
## Enhancements
1. Following suggestions in issue #1448, I've added the filename, line
references and results to the User log dock as comments. The same output
for the last query goes to the usual SQL results widget. The multiple
statement executions are therefore added while executing and not in a
block that might eventually not being executed.
2. I added a busy mouse cursor for giving hint to user when there is a query
in execution and when it has finished.
3. The cursor moves to the erroneous line if the query ends with error.
## Fixes
1. The error indicators where sometimes displaced. This was caused by
manipulations of the query before passing it to SQLite. Whitespace and
comments are discarded by SQLite, so it is better to just let it ignore
them. The only visible change seems that they might be recorded in the log or
or be decorated as error when they are adjacent to the next query.
Transaction bits are replaced by the same amount of spaces, so the
character indexing inside the query isn't perturbed.
2. The default case for the sqlite3_step has been changed to an error case
since all the possible non-error cases have already been treated.
Otherwise constraint errors in INSERT statements (for example) are not
indicated as errors, but the query execution ends anyway.
User can enter the encoding name with completion or select it from the
list using the mouse. This will help users to discover available codecs
and to find a suitable one in an easier way. This should help with encoding
issues like #1453.
The SQL Schema column in DB Schema dock is set to resize automatically
to adjust to the content, like it is already done for the same column in
the Database Structure tab.
A popup menu has been added in the "Open Database" button. A normal click
selects the "Open Database..." action as before. A delayed click opens the
popup menu for selecting either the "Open Database..." action or the
"Open Database Read Only..." action.
"SQL editor font" and "SQL editor font size" are located at the same row
for saving vertical space in the Preferences dialog.
Accelerator keys for "Wrap lines" and "Quotes for identifiers" have been
added.
Some buddies have been fixed.
Modified some tests for taking into account the new standard quoting and
added some more for testing the quoting configuration and for correct
parsing of different quoting styles.
Default branch in escapeIdentifier() for trying to avoid warning.