Commit Graph

2269 Commits

Author SHA1 Message Date
Manuel
87e1c2708d Merge pull request #1302 from sqlitebrowser/bar_charts
Stackable bar charts, Axis Type column and legend in plot.
2018-01-26 18:29:42 +01:00
mgrojo
42bb1c0d65 Translatable strings and default case branch
This addresses review comments by @MKleusberg in PR #1302.
2018-01-26 18:13:20 +01:00
phydroxide
74f19d7bc8 Update BUILDING.md (#1307)
* Update BUILDING.md

Package list for Yum incomplete

* Update BUILDING.md

My first git clone or contribution ever so bear with me
2018-01-26 15:29:38 +01:00
Martin Kleusberg
1110b87d95 Fix structure view after changing settings
This is fixing a follow-up issue of
012ad9217a.

See issue #1288.
2018-01-26 14:44:13 +01:00
Justin Clift
2d95ad44f7 Merge pull request #1303 from ChangJoo-Park/ChangJoo-Park-patch-1
fix typo. database in Korean
2018-01-22 16:24:38 +00:00
ChangJoo Park(박창주)
8c85ff9157 fix typo. database in Korean
database is *데이터베이스*
2018-01-22 21:40:40 +09:00
mgrojo
c5ec23e92e Stacked or grouped bars and plot legend
Two new options added to the context menu of the plot:

- Stacked bars: switches between stacked bars or grouped bars. The former
overlapped layout is avoided since it doesn't make much sense.

- Show legend: toggles the display of a plot legend with a translucent
background. Possible future improvement is dragging the legend with the
mouse.
2018-01-21 17:00:45 +01:00
mgrojo
175407645b Simplify the axis type storing, translucent additional bars and What's This
Now that we have a proper type column in the plot selection widget, the
internal type storing can be simplified.

If the plot has more than one Y selections for one X of label type (bar
charts) the first bar is opaque, but the additional are translucent in
order to be seen, since they will overlap.

What's This information added to explain all the possible selections for
plotting.
2018-01-20 18:28:03 +01:00
mgrojo
aa680622c0 Bar charts and Axis Type column in Plot Dock
String type columns are now selectable as X axis. In that case a bar chart
is plotted where the column values are used as bar labels.

A new Axis Type column is added to the axis selection table, so the user
knows before-hand how the plot will be drawn.

Line type and point shape combo-boxes are not enabled for bar charts, since
they don't make sense.

Columns that make no sense for the Y axis as strings and date/times are not
selectable for that axis.
2018-01-20 18:08:31 +01:00
mgrojo
4b3780e22a Auto-completion for column names in the SQL editor
Isolated column names are added to the list of possible auto-completions,
so they can be completed without having to enter first the table followed
by dot. "Table.field" completion is still supported for completing only for
fields inside that context.

See issue #1242
2018-01-18 22:55:59 +01:00
mgrojo
7d1ddbd717 Preserve format in Copy Create Statement
The original Create statement formatting is preserved when the menu option
"Copy Create statement" is selected, regardless of the setting that removes
the line breaks in the schema view.

The Edit Role is requested to the model for getting the original text data.

See issue #1300
2018-01-18 20:59:02 +01:00
mgrojo
be66535c20 Revert "Merge branch 'master' of https://github.com/sqlitebrowser/sqlitebrowser"
This reverts commit e9385e6f8b, reversing
changes made to d1261146b3.
2018-01-18 20:54:11 +01:00
mgrojo
6a8c2e7a57 Revert "Preserve format in Copy Create Statement"
This reverts commit d1261146b3.
2018-01-18 20:35:08 +01:00
mgrojo
e9385e6f8b Merge branch 'master' of https://github.com/sqlitebrowser/sqlitebrowser 2018-01-18 20:34:07 +01:00
mgrojo
d1261146b3 Preserve format in Copy Create Statement
The original Create statement formatting is preserved when the menu option
"Copy Create statement" is selected, regardless of the setting that removes
the line breaks in the schema view.

The Edit Role is requested to the model for getting the original text data.

See issue #1300
2018-01-18 20:32:07 +01:00
Iulian Onofrei
31f1eafdd8 Fix macOS name in GitHub issue template 2018-01-17 18:11:40 +02:00
mgrojo
33801d5285 Synchronize PlotDock with 'Execute SQL' table. Continuation of PR #1271
Make use of signals to connect the selection in plot to the associated
table widget. Every time that the plot is updated from the Main Window
the table widget associated to the table or query is connected to the plot
and the previous widget is disconnected. This allows the selection of the
correct table widget.

Line selection methods moved to the Extended Table Widget to be used as
slots for this connection.

The destroyed signal is also connected for resetting the plot. This fixes
a crash that already existed before this PR, when closing a SQL tab while
the plot is still associated to the table results model.
2018-01-16 00:37:42 +01:00
Martin Kleusberg
404f48c5a9 Fix possible 'database locked' error when detaching a database
Revert the savepoint in the Execute SQL whenever possible. We need to
do this after each statement because there are some rare cases where
the next statement might be affected by what is only a temporary and
unnecessary savepoint. For example in this case:

ATTACH 'xxx' AS 'db2'
SELECT * FROM db2.xy;    -- Savepoint created here
DETACH db2;              -- Savepoint makes this statement fail

See issue #1249.
2018-01-15 23:51:30 +01:00
Martin Kleusberg
012ad9217a Fix drag & drop of tables onto the structure view
When dragging and dropping a table from one instance of the application
to the other, the tree structure representing the database was broken.
We would show the 'Browsables' and 'All' nodes at the top level instead
of the child nodes of the 'All' node. This happened because after
dropping a table, we would reload the database structure and rebuild the
tree structure but didn't notify the tree view in the main window about
the update. This is fixed by this commit, so the main window's widgets
are always notified about the new tree structure.

See issue #1288.
2018-01-15 23:10:23 +01:00
Martin Kleusberg
39a5460500 Fix crashes in Edit Index dialog when database has no tables
Fix some crashes in the Edit Index dialog which happen if you try to add
a new index when there are no tables in the database yet.

See issue #1293.
2018-01-15 22:38:10 +01:00
Manuel
dbbd268fa2 Merge pull request #1271 from FabianInostroza/plot_table_sync
Synchronize PlotDock with 'Execute SQL' table.
2018-01-15 20:53:54 +01:00
Justin Clift
efb32857d6 Remove AppImage generation, as it's causing 100% build failure 2018-01-13 21:04:07 +00:00
Martin Kleusberg
d17bd9176e Merge branch 'GortiZ6-master' 2018-01-13 16:48:09 +01:00
Giuseppe Zizza
a993c19853 File Extension management interface (#659)
[NEW] Add new interface and functionality to manage database file
extension. (Implements feature request #659)
2018-01-13 16:43:24 +01:00
Martin Kleusberg
58ab9cc1b7 Check for pseudo-PKs when determining whether the model is editable 2018-01-13 16:29:17 +01:00
Manuel
512b694114 Fix crash when Tab is pressed at the last cell of a view's grid (#1289)
The crash is avoided if the table model is not editable, since insertRows
checks that. A table model for a DB view should be not editable, so this
fix avoids the crash and possibly other possible misbehaviours.
2018-01-13 16:27:19 +01:00
mgrojo
b2fbf45012 Plot: detect dates with time, pure dates and times data types
Three different date/time data types are detected and appropriately
displayed in the axis:
- DateTime: "yyyy-MM-dd\nhh:mm:ss"
- Date: "yyyy-MM-dd"
- Time: "hh:mm:ss"
2018-01-11 21:07:06 +01:00
mgrojo
ce2b33ab6d Use the correct function for checking the count of plotted items
Now that the plot may contain graphs and curves, the plottableCount()
function must be used instead of graphCount() for checking whether the plot
has any plotted items.

This had the effect reported in issue #821 of breaking the enable check for
the fetch-all button.
2018-01-08 23:30:55 +01:00
mgrojo
b08960f504 Plot: Respect the "Order by" clause when plotting
The tables/queries sorted by X are drawn using QCPGraph as before.

Since QCPGraph does automatically sort by X, we change to QCPCurve that
requires a third data vector to reflect the order. We get that from the
current row order.

In the case of curves, only None and Line is supported as line style.

Since the order is now important for the plot, it is automatically updated
whenever the user sorts by another column in the browsed table.

This addresses issue #821 and indirectly fixes the problem of incorrect
point->row selection link when the table is not sorted by X, reported in
issue #838.
2018-01-07 14:54:29 +01:00
mgrojo
b99edacc9f Automatic completion of SQL keywords in upper case
Added a new setting for completing the SQL keywords in upper case (default
being true).

Scintilla setAutoCompletionCaseSensitivity is set to false. Otherwise the
completion is only done in lowercase when both case versions are added,
or if only upper case version is added, writing lower case letters does
not use the upper case version of the word in the completion list. This
change doesn't have apparently any downside, since SQL is actually case
insensitive.

Consequently the list of keywords is only added in one of the two letter
case versions, depending on the new setting value.

The new preference check-box is only enabled when the auto-complete
check-box is checked.

See issues #1238 and #1287.
2018-01-06 21:53:15 +01:00
mgrojo
cb98e29a7c Allow deleting and duplicating a selection of rows
Before bbac655499 it was possible to delete
a set of selected rows. This makes it possible again by only selecting the
row if it is not already inside the selected rows. See issue #1283.

Additionally and for coherence, the "Duplicate record" from the context
menu is also made to apply to the list of selected rows. See issue #1090
2018-01-05 20:51:36 +01:00
mgrojo
bbac655499 Select the pointed table row when right clicking on the vertical header
This makes sense from the user point of view, since it remarks that the
options from the menu applies to that row. This change will also fix the
different behaviour of the "Delete record" and "Duplicate record" in the
context menu. See issue #1283
2018-01-05 18:26:34 +01:00
Martin Kleusberg
35b8ac7771 Revert "Fix removing comments from SQL when there are quoted strings"
This reverts commit eae0730e3e.
2018-01-05 18:22:15 +01:00
Martin Kleusberg
652637232d Add tests 2018-01-05 18:20:28 +01:00
Martin Kleusberg
743e7985c2 Add support for conflict clauses to the grammar parser
Add support for parsing and generating CREATE statements with an ON
CONFLICT clause for their primary key.
2018-01-05 17:35:26 +01:00
Martin Kleusberg
29fa332f97 Fix bug introduced in eae0730e3e 2018-01-05 17:24:23 +01:00
Martin Kleusberg
eae0730e3e Fix removing comments from SQL when there are quoted strings
In the code for removing comments from SQL statements we have to make
sure to only match the '--' characters when they are not inside a quoted
string or identifier. This works fine and as expected for single quotes.
However, for double quotes it doesn't. This is fixed by this commit.

See issue #1270.
2018-01-05 16:45:50 +01:00
Martin Kleusberg
7d2931baa2 Add a --read-only command line option
Add a new command line option -R / --read-only for opening a database in
read-only mode.

See issue #1265.
2018-01-05 16:27:23 +01:00
Martin Kleusberg
5f702db0e0 Don't set modified flag for database when attaching/detaching database
Don't set the modified flag of the main database if we're attaching or
detaching another database since these actions don't alter the original
database.

See issue #1249.
2018-01-05 16:07:18 +01:00
Oscar Cowdery Lack
14da8dcf98 Remove hardcoded styles from hyperlinks (#1286)
These hardcoded styles are unnecessary, as Qt will automatically
add styling to hyperlinks that matches the system theme.
2018-01-05 15:56:37 +01:00
Justin Clift
12ad5e5b68 Add SQLCipher to the Ubuntu build instructions 2018-01-05 00:41:27 +00:00
mgrojo
6f5e507556 Right click on vertical header to delete the selected record(s)
The text is got from the "Delete record" button, so the text is updated to
"Delete records" when appropriate.

See feature request #1283
2018-01-04 21:48:19 +01:00
mgrojo
1be61dbb4f Removed unused QDebug include sentences
Last one was accidentally left by commit feda408161
2018-01-04 21:05:24 +01:00
mgrojo
feda408161 Fix wrong BOM detection in startsWithBom and fix BOM checks containing 0
The same fix for BOM detection in startsWithBom as already applied in
c9c848e995 for removeBom, otherwise binary
data is considered text.

Fixed also check for "\x00\x00\xFE\xFF" and "\xFF\xFE\x00\x00", that are
the problematic BOMs since they contain the null character.
2018-01-02 21:13:52 +01:00
Martin Kleusberg
c9c848e995 Fix wrong BOM detection
This fixes a bug introduced in 27c657902e.
In that commit we are checking if a string starts with a Unicode BOM and
remove the BOM if necessary. Apparently though Qt's startsWith()
function doesn't work as exected here, so it's changed to a manual
comparison in this commit which seems to work fine.

The first person who can explain that behaviour to me gets a free beer
if we meet in person.

See issue #1279.
See issue #1282.
2018-01-02 18:15:38 +01:00
Martin Kleusberg
117af5aeeb Put full cell data into INSERT statements when dragging tables
In the Structure tab you can drag & drop entire tables. This copies the
CREATE statement of the table along with the INSERT statements for the
table data. However, for the table data we would use the data as shown
in the table view cells, i.e. 'NULL' for NULL values or truncated data
for very long strings. This is at least partly improved by this commit.
It doesn't treat NULL or BLOB values 100% correctly but fixes the
truncation problem and at least makes the issues in the other cases a
bit more obvious.
2018-01-01 20:11:26 +01:00
Manuel
106e57eedc Allow users to drag and drop fields from DB Schema dock to editor (#1250)
* Allow users to drag and drop fields from DB Schema dock to editor

This is the first attempt to provide the functionality described in #119.

Drag in the dock is enabled (it was only enabled in the Database Structure
tab). Then the fields are enabled for dragging and finally the MIME data
exported for the drag and drop is tailored for exporting only the escaped
field identifier.

This may interfere to other uses of drag&drop in the Database Structure.

* Allow the user to drag individual items from the DB Schema dock

By allowing extended selections of individual items in the dock version,
we let users select what they want to drag and drop. When dragging a list
of items from the Name column, a list of escaped identifiers with commas is
exported, making easier the composition of SELECT and other statements.

In this way, every item name can be dropped, without loosing the ability
of exporting the SQL statement for the item. It will just depend on which
column is selected.

For the DB Structure tab, the original behaviour of single row selection
is maintained. In that case, only the SQL column is exported, as before.

See issue #119.
2018-01-01 20:07:52 +01:00
Martin Kleusberg
27c657902e Improve handling of BOMs in table cells
Detect some Unicode BOMs and always treat data starting with a BOM as
text. We might need to fine-tune this later but it should be an
improvement already.

In the Edit Dialog remove the BOM from the text editor but keep it in
the hex editor. Also add it back to the text when saving changes in text
mode. This way the BOM is out of the way for text edits but is not lost
either when editing a cell.
2018-01-01 17:20:50 +01:00
Martin Kleusberg
8f0312487f Fix cmake build 2018-01-01 15:17:22 +01:00
Martin Kleusberg
5562119563 Move check for binary data into separate function
There are two places in the code where we check for binary data in
database cells. This commit takes the code and moves it into a separate
function so it's easier to improve the situation in both function
simultaneously.
2017-12-31 15:25:01 +01:00