Commit Graph

3721 Commits

Author SHA1 Message Date
Long Nguyen
18de6db149 Refactor CMakeLists, targetify everything 2022-06-12 10:26:21 +07:00
Martin Kleusberg
179d8c5280 cmake: Add a compile time option to statically link the SQLite library
Also use this option in the AppImage workflow to make sure to actually
include the intended version of SQLite.

Note this probably only works fine on Unix-like systems.
2022-06-11 18:02:37 +02:00
Justin Clift
158e32b84e Merge pull request #3067 from atriwidada/master
typo fix
2022-06-11 15:20:56 +10:00
Andika Triwidada
6f21c2a56a typo fix 2022-06-11 11:25:56 +07:00
Justin Clift
21aef5218c Merge pull request #3001 from Biswa96/windres-fix
Fix resource compilation for mingw
2022-06-11 12:11:36 +10:00
Martin Kleusberg
738ecd6feb AppImage: Link against locally built SQLite library 2022-06-10 19:20:02 +02:00
Martin Kleusberg
cc58853b3a build: Add cmake option for using custom built SQLite library 2022-06-10 19:18:04 +02:00
Martin Kleusberg
0ab1cd45ea build: Remove Travis file
Remove the remaining travis.yml file as it is not used any longer.
2022-06-10 18:27:28 +02:00
Łukasz Wojniłowicz
957de60519 Update Polish translation 2022-06-10 14:31:12 +02:00
Werner Mollentze
345750dff3 Updated the packages to build on Ubuntu / Debian
Updated the required package list to build successfully on recent Ubuntu / Debian versions - `qt5-default` was removed in the `qtbase-opensource-src` source package in Debian's version `5.15.1+dfsg-2`.
2022-06-10 14:23:23 +02:00
Martin Kleusberg
f068c2a466 AppImage: Build own version of SQLite to have a more recent version
This downloads and build SQLite from source, currently using version
3.38.5, for building the AppImage file. This way we can include a more
recent version of SQLite instead of shipping the version from Ubuntu
20.04.

See issue #3064.
2022-06-10 14:17:54 +02:00
Martin Kleusberg
e655658597 Respect the sqlite_sequence table when generating PK value for new rows
If there is a record in the sqlite_sequence table for a table we want to
insert into, use that sequence value to generate the next primary key
instead of using the maximum value plus one.

See issue #3026.
2022-06-10 13:38:19 +02:00
Martin Kleusberg
594aa02088 parser: Fix string literals used as column ids in indexed columns
This fixes indexed columns as e.g. used in primary key constraints which
are quoted using single quotes. Because you would never index a string
literal it is safe to assume that text in single quotes actually is a
column identifier.

See issue #3047.
2022-06-05 16:00:58 +02:00
Martin Kleusberg
42c5de7234 Use a separate enum for table constraint types in the Edit Table dialog
This adds a enum of table constraint types to the Edit Table dialog
instead of reusing the enum provided by the sqlb::Constraint class. This
way changes to the sqlb namespace do not affect the Edit Table dialog as
much and in the long term I would like to get rid of the enum in the
sqlb::Constraint class anyway.
2022-06-05 15:21:47 +02:00
Justin Clift
a14e6eb607 Merge pull request #3034 from Mailaender/patch-1
Added version 3.12.2
2022-05-09 02:12:22 +10:00
Matthias Mailänder
b9f4f2be65 Add version 3.12.2 2022-05-08 11:22:23 +02:00
Biswapriyo Nath
638948ed77 Fix resource compilation for mingw
* Include CMAKE_CURRENT_BINARY_DIR for version.h file in winapp.rc.
  Because version.h is now generated by cmake and put in build dir.
* Quote default BUILD_VERSION value, else windres shows syntax error.
2022-04-01 00:30:50 +05:30
Martin Kleusberg
43107ea773 Refactor data structures for table constraints
This is a long overdue continuation of some previous refactoring effort.
Before this we used to store the columns a table constraint belongs to
within the constraint object itself. So for example, a foreign key
constraint object would store the referencing as well as the referenced
column names. While initially simple, this approach has the downside of
duplicating certain data, thus breaking ownership and complicating
matters later on. This becomes obvious when renaming the referencing
column. The column name clearly is a feature of the table but in the
previous approach it also needs to be changed in the foreign key object
as well as in any other constraint for this field even though the
constraint itself has not been touched. This illustrates how a
constraint is not only a property of a table but the field names (a
property of the table) are also a property of the constraint, creating a
circular ownership. This makes the code hard to maintain. It also
invalidates references to constraints in the program needlessly, e.g.
when only changing a column name.

With this commit the column names are removed from the constraint types.
Instead they are now solely a property of the table. This, however,
raised another issue. For unique constraints and primary keys it is
possible to use expressions and/or sorted keys whereas for foreign keys
this is not possible. Additionally check constraints have no columns at
all. So when not storing the used columns inside the constraint objects
we need to have different storage types for each of them. So in a second
step this commit moves the code from a single data structure for storing
all table constraints to three data structures, one for PK and unique,
one for foreign keys, and one for check constraints.

By doing all this, this commit also changes the interface for handling
quite a bit. The new interface tends to use more explicit types which
makes the usage code easier to read.

Please note that this is still far from finished. But future development
on this should be a lot easier now.
2022-03-24 21:37:43 +01:00
Nikolay Zlatev
e55fed2473 SqliteTableModel::headerData skip FontRole for Vertical orientation
This is a performance optimization for TableBrowser

For more info look b6c5024de0
2022-03-22 15:27:07 +02:00
Nikolay Zlatev
18e6a6f703 Icon cleanup
Clean some bad (deprecated) SVG properties, so Qt stop complaints

:/icons/foreground_color:1:1594: Could not parse node: radialGradient
:/icons/foreground_color:1:2684: Could not resolve property: #h
:/icons/background_color:61:31: Could not parse node: radialGradient
:/icons/background_color:86:6: Could not resolve property: #white
2022-03-22 14:11:23 +02:00
Nikolay Zlatev
ad370f693d MainWindow: SqliteTableModel::finishedFetch skip callback for chunk load
Now SqliteTableModel::finishedFetch is active only for row count.
SqlExecutionArea should display proper value for "row count", not
"Prefetch Block Size" when "actual row count" > "Prefetch Block Size"

This should fix #2595
2022-03-22 13:09:15 +02:00
Martin Kleusberg
b3fab20c50 Fix possible crash when browsing a table with multiple PK columns
Because the header of the rowid column would be "Field1,Field2" in the
case of a table with multiple foreign key columns and there is no field
with that name in the table, the application crashed when not checking
for unknown field names.
2022-03-19 20:40:19 +01:00
Martin Kleusberg
c902183ca7 Fix typo in French translation
Thanks to @kanter for spotting this!

See issue #2973.
2022-03-19 20:26:36 +01:00
mgrojo
b6c5024de0 Data Browser: use font style to indicate keys
- Primary keys are underlined
- Foreign keys are italic

See issue #2902
2022-02-18 23:13:38 +01:00
mgrojo
3a4d7d8dfe Open SQL files are now linked when saving project file
This restores the original state of each of the SQL "tabs". If the tab was
opened without a file, the content is saved in the project file itself
(unmodified); when the tab was opened from a file, the reference to the
file is stored in the project file and the contents are restored from
that disk file when loading the project.

See issues #2834, #2972, #2959
2022-02-13 19:03:21 +01:00
Manuel
3c9f218b9f Merge pull request #2952 from manisandro/master
Improve detection of system qcustomplot/qhexedit
2022-02-13 14:05:42 +01:00
Sandro Mani
93b16bdad0 Improve detection of system qcustomplot/qhexedit 2022-01-22 21:31:54 +01:00
Joel Puig Rubio
8158aaf0df Add qt5-image-formats-plugins as a snap staging dependency
Allows MNG, TIFF and WEBP images to be decoded by the snap version.
2022-01-21 10:08:43 +01:00
Joel Puig Rubio
e7b76e502f Add gtk-common-themes to snap 2022-01-21 10:07:15 +01:00
mgrojo
636662b3b0 Icon in data browser for primary key fields
See issue #2902
2022-01-01 23:05:05 +01:00
Martin Kleusberg
d2746c0fb9 Only show numbered sort indicators when more than one column is sorted
I think we tried this approach before and decided to always show the
numbers to  give a hint to the user that it is possible to sort by
multiple columns. But it does look kind of odd this way because it makes
you look for another sorted column.

See issue #2913.
2021-12-28 15:24:26 +01:00
Martin Kleusberg
03ce1405c8 Swap sort order indicators
This way they are more in line with other applications.

See issue #2912.
2021-12-28 15:09:34 +01:00
Manuel
2cd5114670 Bug template improvements
- OS version input
- Nightly version
- Hints for better reports
2021-12-28 12:53:34 +01:00
Martin Kleusberg
2a99d20cdf Fix build on MSVC with Qt 5.12 2021-12-28 11:08:20 +01:00
Martin Kleusberg
a92ab5e6f7 Do not add SQL keywords multiple times to auto completion
When performing certain actions like opening a database file the keyword
list for the auto completion of the SQL text editor gets updated. This
was not only done in a very inefficient manner however but also the list
of keywords was not cleared before adding them again. This wastes memory
and makes the editor even more inefficient.
2021-12-28 11:08:19 +01:00
Manuel
c090f5148d Improvements in the Bug Report template
- Clarified version
- No prepopulated fields, use only placeholder.

See issue #2935
2021-12-28 00:53:40 +01:00
Manuel
3653c97521 Fix yaml indentation in bug template 2021-12-27 22:18:11 +01:00
Manuel
d188fc4342 Fix typos and improvements to the bug template 2021-12-27 22:15:05 +01:00
Manuel
e844fb2b8a Fix error reported by GitHub in Feature template 2021-12-27 21:53:59 +01:00
mgrojo
46f21f030f Change "Feature Request" to new form syntax
Deleted "Question", since the "Discussions" feature is better suited for
that.
2021-12-27 21:51:09 +01:00
Manuel
c13fb7334f Fix title, which must be non-empty 2021-12-27 21:37:45 +01:00
Manuel
2bae1b37f4 Delete old Bug_report.md
Replaced by a new form template
2021-12-27 21:27:18 +01:00
Manuel
d985ae661d Create new issue form template
https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-issue-forms
2021-12-27 21:25:58 +01:00
Martin Kleusberg
3ec1ab3f7c Improve code style 2021-12-27 15:03:35 +01:00
Martin Kleusberg
03808b4c32 Fix memory leak when exporting or importing settings 2021-12-27 14:58:21 +01:00
Martin Kleusberg
7ad6063653 Fix clazy-connect-by-name warnings 2021-12-27 14:54:00 +01:00
Martin Kleusberg
b76f6a6200 Fix a bunch of clazy-range-loop-detach warnings 2021-12-27 12:36:04 +01:00
Martin Kleusberg
db79a66a0f Fix clazy-connect-not-normalized warning 2021-12-27 12:24:19 +01:00
Martin Kleusberg
bcf21c30f0 Fix clazy-qcolor-from-literal warnings 2021-12-27 12:20:43 +01:00
Martin Kleusberg
5b8cf2e111 Fix clazy-qstring-arg warnings 2021-12-27 12:18:08 +01:00