diff --git a/Sqliteman/sqliteman/dataviewer.cpp b/Sqliteman/sqliteman/dataviewer.cpp index 093498b..c5093e7 100644 --- a/Sqliteman/sqliteman/dataviewer.cpp +++ b/Sqliteman/sqliteman/dataviewer.cpp @@ -190,6 +190,7 @@ void DataViewer::findNext(int row) ui.itemView->setCurrentIndex(row, column); } updateButtons(); + ui.statusText->hide(); QApplication::restoreOverrideCursor(); return; } @@ -197,6 +198,7 @@ void DataViewer::findNext(int row) QApplication::restoreOverrideCursor(); } ui.statusText->setPlainText("Not found"); + ui.statusText->show(); } void DataViewer::removeFinder() @@ -267,6 +269,7 @@ void DataViewer::findAll() if (!anyFound) { ui.statusText->setPlainText("No match found"); + ui.statusText->show(); unFindAll(); } else diff --git a/Sqliteman/sqliteman/doc/doc.qrc b/Sqliteman/sqliteman/doc/doc.qrc index e11f747..842b856 100644 --- a/Sqliteman/sqliteman/doc/doc.qrc +++ b/Sqliteman/sqliteman/doc/doc.qrc @@ -56,9 +56,12 @@ en/ch07s11.html en/ch07s12.html en/ch07s13.html + en/ch07s14.html + en/ch07s15.html en/ch08.html en/ch09.html en/ch09s02.html + en/finddialog.png en/index.html en/index.png en/insert_table_row.png diff --git a/Sqliteman/sqliteman/doc/en/ch04.html b/Sqliteman/sqliteman/doc/en/ch04.html index c8b5069..6574fe5 100644 --- a/Sqliteman/sqliteman/doc/en/ch04.html +++ b/Sqliteman/sqliteman/doc/en/ch04.html @@ -8,4 +8,4 @@

Screenshot of the Main Window

All interface elements contains so called "tool tips" – quick notes which are available when you stay with a mouse cursor in the element -are for a while.

+are for a while.

All sqliteman windows remember their dimensions between invocations of sqliteman. If you change the size of a window, it will always reappear with the last size that you set it to.

diff --git a/Sqliteman/sqliteman/doc/en/ch05.html b/Sqliteman/sqliteman/doc/en/ch05.html index 605e3c1..9616fdb 100644 --- a/Sqliteman/sqliteman/doc/en/ch05.html +++ b/Sqliteman/sqliteman/doc/en/ch05.html @@ -13,7 +13,7 @@ See SQL Editor documentation.

Result Table

All queries results and related stuff is shown here. -See Data Browser documentation. +See Data Browser documentation.

Error Log

Error messages and status is written here. This window resizes itself to fit its content, and will not be visible at all if there is no status or error to show.

diff --git a/Sqliteman/sqliteman/doc/en/ch07.html b/Sqliteman/sqliteman/doc/en/ch07.html index d9e0710..4c4aeae 100644 --- a/Sqliteman/sqliteman/doc/en/ch07.html +++ b/Sqliteman/sqliteman/doc/en/ch07.html @@ -1,16 +1,17 @@ Chapter 7. Features and Dialogs

Chapter 7. Features and Dialogs

Table of Contents

Preferences
Look and Feel
Data Display
SQL Editor
User defined functions
Auto Commit and Transaction Pending modes
Create Table
Alter Table
Steps to alter table
Import Table Data
Populate Table
Column Settings
Create View
Create Index
Constraint Triggers
Attached Databases
Schema Browser
Pragma Editor
Query Builder
SQL Editor
-
Data Viewer
Display Types
Data Editor
Multiline Editor
Fetching the data
Export Data
Supported Formats

Preferences

Preferences dialog allows you to customize Sqliteman to fit your needs better.

Look and Feel

You can set GUI behavior in in this section. Remember that Language and Style settings require Sqliteman restart to take effect. Some of these preferences can be overridden by the application +

Find Dialog
+
Data Viewer
Display Types
Data Editor
Multiline Editor
Fetching the data
Export Data
Supported Formats

Preferences

Preferences dialog allows you to customize Sqliteman to fit your needs better.

Look and Feel

You can set GUI behavior in in this section. Remember that Language and Style settings require Sqliteman restart to take effect. Some of these preferences can be overridden by the application command line parameters.

Preferences: Look and Feel

GUI Language

Allow to choose one of the translations for user interface.

Caution

Remember that translations are provide by group of volunteers (not by Sqliteman developers). It's better to contact translation authors in the case of bug.

GUI Style

Change the application "skin". Available styles are depending on platform. Default style should be good choice.

GUI Font

Change the font and/or size used for GUI text.

Recently Used Databases

Specify the count of items in the File->Recent Databases menu.

Open Last Database on Start

When it's checked, the last used database will be opened on the next Sqliteman start.

Open Last SQL Document on Start

When it's checked, the last used SQL script will be opened on the next Sqliteman start.

Rows to read from tables:

This determines the number of rows initially read from a table when opening it. Available choices are 256, 512, 1024, 2048, 4096, or All.

Open New Row in Item View

When it's checked, clicking the - New Row or - Duplicate Row + New Row or + Duplicate Row button will cause the newly created row to be opened in the - Item View.

Data Display

Change settings of the data result viewer here. There is no application restart required here. - Viewer features are described in its own section.

+ Item View.

Data Display

Change settings of the data result viewer here. There is no application restart required here. + Viewer features are described in its own section.

Preferences: Data Display

NULL handling

There is no difference in displaying NULL value and an empty string if is this option disabled.

If you enable this feature, you can set the background color and the substitution string to highlight real NULL value. The empty string display is unchanged.

BLOB handling

If is this option disabled, you will get unfiltered binary content of diff --git a/Sqliteman/sqliteman/doc/en/ch07s00.html b/Sqliteman/sqliteman/doc/en/ch07s00.html new file mode 100644 index 0000000..a831095 --- /dev/null +++ b/Sqliteman/sqliteman/doc/en/ch07s00.html @@ -0,0 +1,16 @@ +User defined functions

User defined functions

+

Sqliteman provides the following user-defined function in addition to the built-in functions supported by sqlite:-

+
+
exec (NAME, STATEMENT)
+
+

This function is called with two arguments which are both sql strings. NAME must be either NULL or a valid sql identifier which is not the name of an existing table or view. Otherwise the exec() function will fail with an appropriate error message. The exec() function can also fail if sqlite runs out of memory or encounters a similar fatal error.

+
    +
  • If NAME is NULL, exec() returns the first row of the first column of the table returned by executing STATEMENT as an sql statement. If executing STATEMENT fails or succeeds but does not generate a table, exec() returns NULL.
  • +
  • If NAME is a valid sql identifier which is not the name of an existing table or view, the exec() function creates table NAME containing the result of attempting to execute STATEMENT as an sql statement, and exec() itself returns a null. In this case if STATEMENT succeeds but does not generate a table, exec() does not create a table and returns NULL, and if STATEMENT fails exec() does not create a table and returns the error message caused by the failure. Normally EXPLAIN, most PRAGMAs, SELECT, and VALUES statements generate tables if they succeed.
  • +
+

exec() can be used in scripts to execute dynamically generated statements, check for errors, and examine results of PRAGMAs. The form with a NULL first argument can be used to extract a value from a table without causing the script to fail if the table does not exist.

+

exec() is used by Sqliteman's internal tests. These are included in the source distribution and can be examined as examples for how to use it.

+
+
+

Sqliteman also provides two additonal collators LOCALIZED and LOCALIZED_CASE. These sort in Locale order. LOCALIZED is like the LOCALIZED collator provided by the Android implementation of sqlite (which is not case-sensitive), while the LOCALIZED_CASE collator is case-sensitive. Care should be taken when using these collators. It is always safe to use them in queries inside sqliteman itself. However if an object (such as a view) is created in the database referencing LOCALIZED or LOCALIZED_CASE, it will not be possible to access that object with an sqlite implementation which does not support that collator. +

diff --git a/Sqliteman/sqliteman/doc/en/ch07s01.html b/Sqliteman/sqliteman/doc/en/ch07s01.html index ae193e0..4b99cf8 100644 --- a/Sqliteman/sqliteman/doc/en/ch07s01.html +++ b/Sqliteman/sqliteman/doc/en/ch07s01.html @@ -1,7 +1,7 @@ Auto Commit and Transaction Pending modes

Auto Commit and Transaction Pending modes

Sqliteman can operate in Auto Commit mode or in Transaction Pending mode. It starts off in Auto Commit mode. It can go into Transaction Pending mode if the user executes a BEGIN command or a SAVEPOINT name command in the SQL Editor without a corresponding COMMIT, ROLLBACK, or RELEASE SAVEPOINT command. Executing a COMMIT or ROLLBACK command, or executing a RELEASE SAVEPOINT on the highest level savepoint, will take Sqliteman back to Auto Commit mode

-

In Auto Commit mode, all actions driven by the menus are committed to the database immediately, if they succeed. Editing fields, adding rows, or deleting rows in the current table (if there is one) result in changes cached inside Sqliteman until they are committed by pressing the Commit button or discarded by pressing the Rollback button. If you leave the current table, or select any menu action which modifies it, Sqliteman will ask if you want to commit your changes: the exceptions are Empty Table and Drop table, both of which discard all the data in the table anyway.

-

In Transaction Pending mode, all actions driven by the menus are added to the pending transaction. Editing fields, adding rows, or deleting rows in the current table (if there is one) result in changes cached inside Sqliteman, but the Commit button only writes the changes to the database, adding them to the pending transaction, and does not commit them. The Rollback button discards the changes as in Auto Commit mode. If you leave the current table, or select any menu action which modifies it, Sqliteman will ask if you want to write your changes to the database: the exceptions are Empty Table and Drop table, both of which discard all the data in the table anyway. To commit your changes, you need to execute a COMMIT or ROLLBACK command, or a RELEASE SAVEPOINT on the highest level savepoint, in the SQL Editor.

+

In Auto Commit mode, all actions driven by the menus are committed to the database immediately, if they succeed. Editing fields, adding rows, or deleting rows in the current table (if there is one) result in changes cached inside Sqliteman until they are committed by pressing the Commit button or discarded by pressing the Rollback button. If you leave the current table, or select any menu action which modifies it, Sqliteman will ask if you want to commit your changes: the exceptions are Empty Table and Drop table, both of which discard all the data in the table anyway.

+

In Transaction Pending mode, all actions driven by the menus are added to the pending transaction. Editing fields, adding rows, or deleting rows in the current table (if there is one) result in changes cached inside Sqliteman, but the Commit button only writes the changes to the database, adding them to the pending transaction, and does not commit them. The Rollback button discards the changes as in Auto Commit mode. If you leave the current table, or select any menu action which modifies it, Sqliteman will ask if you want to write your changes to the database: the exceptions are Empty Table and Drop table, both of which discard all the data in the table anyway. To commit your changes, you need to execute a COMMIT or ROLLBACK command, or a RELEASE SAVEPOINT on the highest level savepoint, in the SQL Editor.

If you try to exit from Sqliteman, and some changes are cached, it will ask you if you want to write the changes to the database or discard them or cancel the exit. Next, if Sqliteman is in Pending Transaction mode, it will ask you if you want to commit the pending transaction, roll it back, or cancel the exit. Sqliteman cannot tell whether the pending transaction contains any changes to the database, so it asks even if there are no changes.

diff --git a/Sqliteman/sqliteman/doc/en/ch07s12.html b/Sqliteman/sqliteman/doc/en/ch07s12.html index b56da40..55eb920 100644 --- a/Sqliteman/sqliteman/doc/en/ch07s12.html +++ b/Sqliteman/sqliteman/doc/en/ch07s12.html @@ -1,4 +1,4 @@ -SQL Editor

SQL Editor

The SQL Editor is the place to create, test and examine your statements. +SQL Editor

SQL Editor

The SQL Editor is the place to create, test and examine your statements. There are some additional features made for your easier life. Of course you can customize editor behavior in Preferences.

Important

Transaction handling. Transactions in the SQL scripts (in this editor) are under user control. There is no autocommit and automatic transaction starting. @@ -24,4 +24,5 @@ the Save As dialog is shown.

Save Document As

Save the current file with changed name.

Search in the document Ctrl+F -

Open or close the Search panel in the bottom of the SQL Editor.

+

Open or close the Search panel in the bottom of the SQL Editor.

diff --git a/Sqliteman/sqliteman/doc/en/ch07s13.html b/Sqliteman/sqliteman/doc/en/ch07s13.html index 5fd36a3..50e2017 100644 --- a/Sqliteman/sqliteman/doc/en/ch07s13.html +++ b/Sqliteman/sqliteman/doc/en/ch07s13.html @@ -1,18 +1,18 @@ -Data Viewer +Find Dialog - + diff --git a/Sqliteman/sqliteman/doc/en/ch07s14.html b/Sqliteman/sqliteman/doc/en/ch07s14.html index f4ebff2..d98fa48 100644 --- a/Sqliteman/sqliteman/doc/en/ch07s14.html +++ b/Sqliteman/sqliteman/doc/en/ch07s14.html @@ -1,6 +1,828 @@ -Export Data

Export Data

Current result set in the Data Viewer can be exported - in this dialog. The export will contain all data even although there are records waiting for fetch: - all data are fetched before export starts.

Warning

Data exporting may be resource and time consuming operation. Be patient if you - are exporting a large amount of data.

-

Export Data

-

Format

Chose one of supported formats to export.

Export to

File - export data into file on local filesystem.

Clipboard - export data to the clipboard for pasting into another application directly.

File

Path to file if is the File method selected.

Export Headers Too

Column names will be exported too if is this option is enabled. If exporting in SQL inserts format, a CREATE TABLE statement with the column name will be put at the start of the output.

Encoding

Text encoding of the exported data. UTF8 is commonly the best option.

Line End

Allow to change text line ending (CR/LF) to fit various operating systems implementations.

Supported Formats

  • Comma Separated Values (CSV)

  • HTML table

  • Microsoft Excel XML

    Caution

    MS Excel XML is not the binary XLS document. It's special case of XML file.

  • Python list. A list structure for Python programming language.

  • SQL inserts, Insert statements in ANSI form.

+ + +Data Viewer + + + + + + + + + + +
+
+

+ Data Viewer +

+
+

All data are displayed here. Displayed data can be:

+
+ +
+

Changes in Data Viewer are handled in a separate transaction. So you + have to + click the + Commit + + button to promote them into the database file or the + Rollback + + button to discard them. +

+
+

Important

+

Transactions in the Data Viewer are separate from transactions + in the SQL Editor. You cannot commit your Data Viewer changes by a + COMMIT + in the SQL Editor. However if you have a pending transaction + (unclosed + BEGIN TRANSACTION + or + SAVEPOINT) + from the SQL editor you have to close that as well after using the + Commit + + button in order for your changes to become permanent in the + database. See + + Auto Commit and Transaction Pending modes + + for further details. +

+
+

Data changes are available only for tables (invoked in Schema Browser). + There is no way to edit the data returned by an SQL statement yet. +

+

+
+
+
+ + + + Find... + + +
+
+

+ +

+ This button is enabled only when viewing a table. It + opens a dialog enabling you to search in the table. + The search conditions are similar to those for the + Query Builder. + However the effect is different. You can find the + first or the next occurrence of a match in the + table. You can also find all matches. +

+

+ Note however that "Find All" is slower than doing a + Query Builder + query because it is done by reading each row and + checking if it satisfies the match conditions. This + does not make use of sqlite's internal optimisations. +

+ +

+
+
+ + + + New Row + + +
+
+

+ + This button is enabled only when viewing a table. It + creates a new and empty row at the end of the table. + Default values are prefilled except for PRIMARY KEY + AUTOINCREMENT fields. + Commit + action is required to make this permanent. If a field + has a default of CURRENT_TIMESTAMP, CURRENT_DATE, or + CURRENT_TIME, it will be prefilled with the date and/or + time when the record is created, but if the field is + not modified it will be overwritten when changes are + committed with the date and/or time then. + +

+
+
+ + + + Duplicate Row + + +
+
+

+ + This button is enabled only when viewing a table and a + current row is selected. It creates a copy of the + current row at the end of the table (this can be useful + when creating rows which differ only in one field). Note + that the Qt SQL library gets confused + if the database contains multiple rows with the same + data fields: make sure to modify the copy before + committing. + Commit + action is required to make this permanent. + +

+
+
+ + + + Remove Row + + +
+
+

+ + This button is enabled only when viewing a table and a + current row is selected. It deletes the selected row + from the table. + Commit + action is required to make this permanent. + +

+
+
+ + + + Delete Multiple + + +
+
+

+ + This button replaces the + Remove Row + button when you have just executed a query created by + the + Query Builder. + It deletes all the records found by the query from the + table against which the query was run. It will ask you + if you really want to do this first as this can delete a + lot of records. This is an immediate action and does not + require + Commit + action to update the database. Note this button is not + available after executing a query from the + SQL Editor + widget, since this can contain a more complex SELECT + which cannot be simply modified into a DELETE + statement. + +

+
+
+ + + + Commit + + +
+
+

+ + This button is enabled only when changes have been made + in the DataViewer. It promotes the changes into the + database. + +

+
+
+ + + + Rollback + + +
+
+

+ + This button is enabled only when changes have been made + in the DataViewer. It rejects the changes and reloads + the Data Viewer from the database. + +

+
+
+ + + + Blob Preview + + +
+
+

+ + Enable or disable BLOB preview widget. The blob preview + widget can only be enabled when a field containing a + blob is selected, but it can be disabled whenever it is + enabled. If the blob preview is enabled, it will appear + whenever a field containing a blob is selected and it + will attempt to display the blob as an image. + +

+
+
+ + + + Data Export + + +
+
+

+ + Open the Data Export dialog. You can export currently + selected data in various formats. + + See Data Export documentation. + +

+
+
+ + + + Table Snapshot + + +
+
+

+ + Duplicate current result table into a new read only + window. You can compare data versions etc. with it. + +

+
+
+ + + + Go to line number + + +
+
+

+ + This button pops up a dialog to select a row number. It + will select the first field of that row and scroll the + Data Viewer to make it4 visible. It ignores any attempt + to go to a row which has been deleted. + +

+
+
+
+
+
+

Display Types

+
+
+
+
+ + Full View + +
+
+
+ Data Viewer/Browser +
+
+
+

+ Display data as a table. This is the most common view + on SQL results. +

+

+ Clicking on the Item View tab will display the + Item View + for the currently selected row (the tab is disabled + when there is no current row). Double-clicking on a row + number in the Full View will open the + Item View + for that row. +

+

+ The following functions are available from the context + menu invoked by right-clicking in a field, or with the + keyboard shortcuts shown:- +

+
+
+ Copy Whole + + Ctrl+W + +
+
+ Copies the whole field to the Clipboard. +
+
+ Paste Over + + Ctrl+Alt+V + +
+
+ If there is text in the Clipboard, replace the + whole field with that text: otherwise do nothing. +
+
+ + Insert NULL + + + Ctrl+Alt+N + +
+
+ Replace the contents of the field with a Null: SQL + does not treat a Null field the same as an empty + one. +
+
+ Open In-line Editor + + Ctrl+Space + +
+
+ Open the + In-line Editor + in the field. This can also be invoked by + double-clicking on the field. +
+ + Open Multiline Editor + + + Ctrl+Alt+E + +
+
+ Bring up the + Multiline Editor + to edit the contents of the field in a pop-up + window. +
+
+
+
+ + Item View + +
+
+
+ Item Viewer/Browser +
+
+
+

+ The Item View displays only one row at a time, but + with more space to edit each field. The navigation + buttons at the right move to the first, previous, next, and last row respectively, and are disabled if + you are already at that row. Below the navigation + buttons there are two small buttons to overwrite the + selected field with a NULL and to open the + Multiline Editor: + these are only visible if the table is editable. + You can also use the + go to line number + button. +

+

+ This view is now fully editable and synchronised + with the Full View. If you are using NULL + higlighting, the NULL alias will disappear if you + click on a NULL field in an editable table, so that + you can type something in there. +

+

+ The following functions are available from the context + menu invoked by right-clicking in a field, or with the + keyboard shortcuts shown:- +

+
+
+ Copy + + Ctrl+C + +
+
+ Copies the selected text to the Clipboard. +
+
+ Copy Whole + + Ctrl+W + +
+
+ Copies the whole field to the Clipboard. +
+
+ Cut + + Ctrl+X + +
+
+ Copies the selected text to the Clipboard and + deletes it from the field. +
+
+ Paste + + Ctrl+V + +
+
+ Pastes text from the Clipboard in place of the + selection or at the cursor position if nothing is + selected. +
+
+ Paste Over + + Ctrl+Alt+V + +
+
+ If there is text in the Clipboard, replace the + whole field with that text: otherwise do nothing. +
+
+ + Insert NULL + + + Ctrl+Alt+N + +
+
+ Replace the contents of the field with a Null: SQL + does not treat a Null field the same as an empty + one. +
+
+ + Open Multiline Editor + + + Ctrl+Alt+E + +
+
+ Bring up the + Multiline Editor + to edit the contents of the field in a pop-up + window. +
+
+
+
+ + Script Output + +
+
+ Results from the + Describe + menu action or from running multiple commands as a + script in the + SQL Editor + are listed in this tab. It is automatically + selected if you run a script which does not generate a + table. +
+
+
+
+
+
+

Data Editing

+
+
+
+
+

+ In-line Editor +

+
+
+
+
+ Simple Data Editor +
+
+

+ Simple strings can be edited in this widget. There are + also two buttons:- +

+
+
+
+ + + Set NULL + + + Ctrl+Alt+N + + +
+
+ + Set the cell to the real NULL value. + +
+
+ + + Multiline Editor + + + Ctrl+Alt+E + + +
+
+ + Open multiline editor + +
+
+
+
+
+
+

+ Multiline Editor +

+

+ This dialog is designed because the In-line Editor cannot handle + advanced features comfortably. It allows you to edit multi line + texts, BLOBs and the other special data formats. +

+
+
+ Advanced Data Editor +
+
+

+ When you accept changes in this dialog with the + OK + button, only the result of the active tab will be promoted to the + Data Viewer. If the + Insert NULL + option is checked, only NULL is inserted. As usual the + commit + button then has to be used to promote the changes into the database. +

+
+
+
+ Text tab +
+
+

+ Full plain text editor. There is no rich text support. +

+
+
+ Blob tab +
+
+

+ The content of the chosen file will be transferred into + the cell as is. No data transformations are performed. + The original value of the cell can be saved into a local + file with the + Save... + button. +

+
+
+ Date to String tab +
+
+

+ A helper wizard for storing date and time in string + values. +

+
+

Important

+

+ Consult the Sqlite manual for date and time issues. +

+
+

+ The + Date + item in this form can be set with a drop-down calendar + by clicking on the arrow to the right of the date. +

+

+ The + String Format + should be set with a + + date time transform mask. + + Consult the + + Qt4 documentation + for an explanation of its codes. +

+
+ +

Example Date to String +

+

+ E. g. + + dd.MM.yyyy hh:mm.ss + + will produce + + "24.12.2007 18:30:45" + +

+
+
+
+
+
+
+
+

+ + Fetching the data +

+
+
+

+ Sqliteman + can use progressive (step-by-step) fetching of data in the result set. + This means that you don't need to wait until all data are transferred + from the database file to + the result table. +

+

+ When you call a select statement from table with e.g. thousands of rows + only the first part of rows is physically fetched. The remaining rows + are available on demand - scrolling down in the result table will perform next fetch. +

+

+ A message in the error log widget will inform you: +

+

+ + More rows can be fetched. Scroll the result set for more rows and/or + read the documentation. + +

+

+ Alternatively you can set a + preference + to read all of a table when opening it: this can be more convenient on a + fast computer with plenty of memory. +

+
+
+

+ + Incremental Search +

+
+
+

+ If you select a column by clicking on the column name at the top, and + then type characters, + Sqliteman + will do an incremental search on the data in the selected column. The + view will be scrolled so that the first matching row is visible, at the + top of the window unless there are not enough rows below it to fill the + window. This works best with a sorted column, but + Sqliteman + will do the search anyway. +

+
+ + + diff --git a/Sqliteman/sqliteman/doc/en/ch07s15.html b/Sqliteman/sqliteman/doc/en/ch07s15.html new file mode 100644 index 0000000..f4ebff2 --- /dev/null +++ b/Sqliteman/sqliteman/doc/en/ch07s15.html @@ -0,0 +1,6 @@ +Export Data

Export Data

Current result set in the Data Viewer can be exported + in this dialog. The export will contain all data even although there are records waiting for fetch: + all data are fetched before export starts.

Warning

Data exporting may be resource and time consuming operation. Be patient if you + are exporting a large amount of data.

+

Export Data

+

Format

Chose one of supported formats to export.

Export to

File - export data into file on local filesystem.

Clipboard - export data to the clipboard for pasting into another application directly.

File

Path to file if is the File method selected.

Export Headers Too

Column names will be exported too if is this option is enabled. If exporting in SQL inserts format, a CREATE TABLE statement with the column name will be put at the start of the output.

Encoding

Text encoding of the exported data. UTF8 is commonly the best option.

Line End

Allow to change text line ending (CR/LF) to fit various operating systems implementations.

Supported Formats

  • Comma Separated Values (CSV)

  • HTML table

  • Microsoft Excel XML

    Caution

    MS Excel XML is not the binary XLS document. It's special case of XML file.

  • Python list. A list structure for Python programming language.

  • SQL inserts, Insert statements in ANSI form.

diff --git a/Sqliteman/sqliteman/doc/en/dataViewer.png b/Sqliteman/sqliteman/doc/en/dataViewer.png index e647dd3..dcf5343 100644 Binary files a/Sqliteman/sqliteman/doc/en/dataViewer.png and b/Sqliteman/sqliteman/doc/en/dataViewer.png differ diff --git a/Sqliteman/sqliteman/doc/en/delete_multiple.png b/Sqliteman/sqliteman/doc/en/delete_multiple.png new file mode 100644 index 0000000..4dfe6ad Binary files /dev/null and b/Sqliteman/sqliteman/doc/en/delete_multiple.png differ diff --git a/Sqliteman/sqliteman/doc/en/finddialog.png b/Sqliteman/sqliteman/doc/en/finddialog.png new file mode 100644 index 0000000..4c178c6 Binary files /dev/null and b/Sqliteman/sqliteman/doc/en/finddialog.png differ diff --git a/Sqliteman/sqliteman/doc/en/index.html b/Sqliteman/sqliteman/doc/en/index.html index 29f1eec..4e01dda 100644 --- a/Sqliteman/sqliteman/doc/en/index.html +++ b/Sqliteman/sqliteman/doc/en/index.html @@ -36,4 +36,6 @@ Query Builder
SQL Editor
-
Data Viewer
Display Types
Data Editor
Multiline Editor
Fetching the data
Export Data
Supported Formats
8. Questions and Answers
Known Issues
9. Credits and License
Contributors
Translations
Logo and the main icon
Icons
Licenses
A. Installation
How to obtain Sqliteman
MS Windows
Linux
Mac OS X
Other UNIXes
Source Code
Requirements
Compilation and Installation
Configuration

List of Examples

7.1. Full Alter Table Example
7.2. Date to String
+
+Find Dialog
+
Data Viewer
Display Types
Data Editor
Multiline Editor
Fetching the data
Export Data
Supported Formats
8. Questions and Answers
Known Issues
9. Credits and License
Contributors
Translations
Logo and the main icon
Icons
Licenses
A. Installation
How to obtain Sqliteman
MS Windows
Linux
Mac OS X
Other UNIXes
Source Code
Requirements
Compilation and Installation
Configuration

List of Examples

7.1. Full Alter Table Example
7.2. Date to String
diff --git a/Sqliteman/sqliteman/doc/en/itemViewer.png b/Sqliteman/sqliteman/doc/en/itemViewer.png new file mode 100644 index 0000000..aa3539f Binary files /dev/null and b/Sqliteman/sqliteman/doc/en/itemViewer.png differ diff --git a/Sqliteman/sqliteman/doc/en/mainwindow-notes.png b/Sqliteman/sqliteman/doc/en/mainwindow-notes.png index ed9d719..8019346 100644 Binary files a/Sqliteman/sqliteman/doc/en/mainwindow-notes.png and b/Sqliteman/sqliteman/doc/en/mainwindow-notes.png differ diff --git a/Sqliteman/sqliteman/doc/en/mainwindow.png b/Sqliteman/sqliteman/doc/en/mainwindow.png index 104e8b4..67fc0b6 100644 Binary files a/Sqliteman/sqliteman/doc/en/mainwindow.png and b/Sqliteman/sqliteman/doc/en/mainwindow.png differ diff --git a/Sqliteman/sqliteman/doc/en/queryFields.png b/Sqliteman/sqliteman/doc/en/queryFields.png new file mode 100644 index 0000000..0eab25d Binary files /dev/null and b/Sqliteman/sqliteman/doc/en/queryFields.png differ diff --git a/Sqliteman/sqliteman/doc/en/queryOrder.png b/Sqliteman/sqliteman/doc/en/queryOrder.png new file mode 100644 index 0000000..e25b189 Binary files /dev/null and b/Sqliteman/sqliteman/doc/en/queryOrder.png differ diff --git a/Sqliteman/sqliteman/doc/en/queryTerms.png b/Sqliteman/sqliteman/doc/en/queryTerms.png new file mode 100644 index 0000000..647a18f Binary files /dev/null and b/Sqliteman/sqliteman/doc/en/queryTerms.png differ diff --git a/Sqliteman/sqliteman/finddialog.cpp b/Sqliteman/sqliteman/finddialog.cpp new file mode 100644 index 0000000..321c6cd --- /dev/null +++ b/Sqliteman/sqliteman/finddialog.cpp @@ -0,0 +1,169 @@ +/* +For general Sqliteman copyright and licensing information please refer +to the COPYING file provided with the program. Following this notice may exist +a copyright and/or license notice that predates the release of Sqliteman +for which a new license (GPL+exception) is in place. +*/ + +#include +#include +#include +#include +#include +#include + +#include "database.h" +#include "dataviewer.h" +#include "finddialog.h" +#include "sqlparser.h" +#include "ui_finddialog.h" +#include "ui_termstabwidget.h" +#include "utils.h" + +bool FindDialog::notSame(QStringList l1, QStringList l2) +{ + QStringList l1s = QStringList(l1); + QStringList l2s = QStringList(l2); + l1s.sort(); + l2s.sort(); + return l1s != l2s; +} + +void FindDialog::closeEvent(QCloseEvent * event) +{ + emit findClosed(); + QMainWindow::closeEvent(event); +} + +FindDialog::FindDialog(QWidget * parent) +{ + setupUi(this); + connect(finishedbutton, SIGNAL(clicked()), this, SLOT(close())); + QSettings settings("yarpen.cz", "sqliteman"); + int hh = settings.value("finddialog/height", QVariant(400)).toInt(); + int ww = settings.value("finddialog/width", QVariant(600)).toInt(); + resize(ww, hh); +} + +FindDialog::~FindDialog() +{ + QSettings settings("yarpen.cz", "sqliteman"); + settings.setValue("finddialog/height", QVariant(height())); + settings.setValue("finddialog/width", QVariant(width())); +} + +void FindDialog::updateButtons() +{ + bool enabled = termsTab->termsTable->rowCount() != 0; + findfirst->setEnabled(enabled); + findnext->setEnabled(enabled); + findall->setEnabled(enabled); +} + +void FindDialog::doConnections(DataViewer * dataviewer) +{ + connect(findfirst, SIGNAL(clicked()), + dataviewer, SLOT(findFirst())); + connect(findnext, SIGNAL(clicked()), + dataviewer, SLOT(findNext())); + connect(findall, SIGNAL(clicked()), + dataviewer, SLOT(findAll())); + connect(this, SIGNAL(findClosed()), + dataviewer, SLOT(findClosing())); + connect(termsTab->termMoreButton, SIGNAL(clicked()), + this, SLOT(updateButtons())); + connect(termsTab->termLessButton, SIGNAL(clicked()), + this, SLOT(updateButtons())); +} + +void FindDialog::setup(QString schema, QString table) +{ + setWindowTitle(QString("Find in table ") + schema + "." + table); + QStringList columns; + SqlParser * parser = Database::parseTable(table, schema); + foreach (FieldInfo i, parser->m_fields) { columns << i.name; } + delete parser; + if ( (schema != m_schema) + || (table != m_table) + || (notSame(termsTab->m_columnList, columns))) + { + m_schema = schema; + m_table = table; + termsTab->m_columnList = columns; + termsTab->termsTable->clear(); + termsTab->termsTable->setRowCount(0); + } + updateButtons(); +} + +bool FindDialog::isMatch(QSqlRecord * rec, int i) +{ + QComboBox * field = qobject_cast + (termsTab->termsTable->cellWidget(i, 0)); + QComboBox * relation = qobject_cast + (termsTab->termsTable->cellWidget(i, 1)); + QLineEdit * value = qobject_cast + (termsTab->termsTable->cellWidget(i, 2)); + if (field && relation) + { + QVariant data(rec->value(field->currentText())); + switch (relation->currentIndex()) + { + case 0: // Contains + return data.toString().contains(value->text()); + + case 1: // Doesn't contain + return !(data.toString().contains(value->text())); + + case 2: // Starts with + return data.toString().startsWith(value->text()); + + case 3: // Equals + return data.toString() == value->text(); + + case 4: // Not equals + return data.toString() != value->text(); + + case 5: // Bigger than + return data.toString() > value->text(); + + case 6: // Smaller than + return data.toString() < value->text(); + + case 7: // is null + return data.isNull(); + + case 8: // is not null + return !(data.isNull()); + } + } + return false; +} + +bool FindDialog::isMatch(QSqlRecord * rec) +{ + int terms = termsTab->termsTable->rowCount(); + if (terms > 0) + { + if (termsTab->andButton->isChecked()) + { + for (int i = 0; i < terms; ++i) + { + if (!isMatch(rec, i)) { return false; } + } + return true; + } + else // or button must be checked + { + for (int i = 0; i < terms; ++i) + { + if (isMatch(rec, i)) { return true; } + } + return false; + } + } + else + { + return true; // empty term list matches anything + } +} diff --git a/Sqliteman/sqliteman/finddialog.h b/Sqliteman/sqliteman/finddialog.h new file mode 100644 index 0000000..9828fad --- /dev/null +++ b/Sqliteman/sqliteman/finddialog.h @@ -0,0 +1,55 @@ +/* +For general Sqliteman copyright and licensing information please refer +to the COPYING file provided with the program. Following this notice may exist +a copyright and/or license notice that predates the release of Sqliteman +for which a new license (GPL+exception) is in place. +*/ + +#ifndef FINDDIALOG_H +#define FINDDIALOG_H + +class QCloseEvent; +class QSqlRecord; +class QTreeWidgetItem; + +class DataViewer; + +#include "ui_finddialog.h" +#include "ui_termstabwidget.h" + +/*! + * @brief A modeless window for doing searches + * \author Richard Parkins + */ +class FindDialog : public QMainWindow, public Ui::findDialog +{ + Q_OBJECT + + private: + QString m_schema; + QString m_table; + bool notSame(QStringList l1, QStringList l2); + + protected: + void closeEvent(QCloseEvent * event); + + public slots: + void updateButtons(); + + public: + /*! + * @brief Creates the query editor. + * @param parent The parent widget for the dialog. + */ + FindDialog(QWidget * parent = 0); + ~FindDialog(); + void doConnections(DataViewer * dataviewer); + void setup(QString schema, QString table); + bool isMatch(QSqlRecord * rec, int i); + bool isMatch(QSqlRecord * rec); + + signals: + void findClosed(); +}; + +#endif //FINDDIALOG_H diff --git a/Sqliteman/sqliteman/finddialog.ui b/Sqliteman/sqliteman/finddialog.ui new file mode 100644 index 0000000..9d60b6f --- /dev/null +++ b/Sqliteman/sqliteman/finddialog.ui @@ -0,0 +1,80 @@ + + + findDialog + + + + 0 + 0 + 520 + 300 + + + + + 0 + 0 + + + + + + QLayout::SetMinimumSize + + + + + + 0 + 1 + + + + + + + + + + + Find First + + + + + + + Find Next + + + + + + + Find All + + + + + + + Finished + + + + + + + + + + + + TermsTabWidget + QWidget +
termstabwidget.h
+
+
+ + +
diff --git a/Sqliteman/sqliteman/termstabwidget.cpp b/Sqliteman/sqliteman/termstabwidget.cpp new file mode 100644 index 0000000..a514a5f --- /dev/null +++ b/Sqliteman/sqliteman/termstabwidget.cpp @@ -0,0 +1,98 @@ +/* +For general Sqliteman copyright and licensing information please refer +to the COPYING file provided with the program. Following this notice may exist +a copyright and/or license notice that predates the release of Sqliteman +for which a new license (GPL+exception) is in place. +*/ + +#include +#include + +#include "termstabwidget.h" +#include "utils.h" + +TermsTabWidget::TermsTabWidget(QWidget * parent): QWidget(parent) +{ + setupUi(this); + + termsTable->setColumnCount(3); + termsTable->horizontalHeader()->hide(); + termsTable->verticalHeader()->hide(); + termsTable->setShowGrid(false); + + connect(termMoreButton, SIGNAL(clicked()), + this, SLOT(moreTerms())); + connect(termLessButton, SIGNAL(clicked()), + this, SLOT(lessTerms())); + +} + +void TermsTabWidget::paintEvent(QPaintEvent * event) +{ + Utils::setColumnWidths(termsTable); + QWidget::paintEvent(event); +} + +void TermsTabWidget::moreTerms() +{ + int i = termsTable->rowCount(); + termsTable->setRowCount(i + 1); + QComboBox * fields = new QComboBox(); + fields->addItems(m_columnList); + termsTable->setCellWidget(i, 0, fields); + QComboBox * relations = new QComboBox(); + relations->addItems(QStringList() << tr("Contains") << tr("Doesn't contain") + << tr("Starts with") + << tr("Equals") << tr("Not equals") + << tr("Bigger than") << tr("Smaller than") + << tr("Is null") << tr("Is not null")); + termsTable->setCellWidget(i, 1, relations); + connect(relations, SIGNAL(currentIndexChanged(const QString &)), + this, SLOT(relationsIndexChanged(const QString &))); + QLineEdit * value = new QLineEdit(); + termsTable->setCellWidget(i, 2, value); + termsTable->resizeColumnsToContents(); + termLessButton->setEnabled(true); + update(); +} + +void TermsTabWidget::lessTerms() +{ + int i = termsTable->rowCount() - 1; + termsTable->removeRow(i); + termsTable->resizeColumnsToContents(); + if (i == 0) { termLessButton->setEnabled(false); } + update(); +} + +void TermsTabWidget::relationsIndexChanged(const QString &) +{ + QComboBox * relations = qobject_cast(sender()); + for (int i = 0; i < termsTable->rowCount(); ++i) + { + if (relations == termsTable->cellWidget(i, 1)) + { + switch (relations->currentIndex()) + { + case 0: // Contains + case 1: // Doesn't contain + case 2: // Starts with + case 3: // Equals + case 4: // Not equals + case 5: // Bigger than + case 6: // Smaller than + if (!(termsTable->cellWidget(i, 2))) + { + termsTable->setCellWidget(i, 2, new QLineEdit()); + } + return; + + case 7: // is null + case 8: // is not null + termsTable->removeCellWidget(i, 2); + return; + } + } + } + update(); +} diff --git a/Sqliteman/sqliteman/termstabwidget.h b/Sqliteman/sqliteman/termstabwidget.h new file mode 100644 index 0000000..5f7c839 --- /dev/null +++ b/Sqliteman/sqliteman/termstabwidget.h @@ -0,0 +1,42 @@ +/* +For general Sqliteman copyright and licensing information please refer +to the COPYING file provided with the program. Following this notice may exist +a copyright and/or license notice that predates the release of Sqliteman +for which a new license (GPL+exception) is in place. +*/ + +#ifndef TERMSTABWIDGET_H +#define TERMSTABWIDGET_H + +#include "ui_termstabwidget.h" + +/*! + * @brief A widget for manging a list of test terms + * \author Igor Khanin + * \author Petr Vanek + * \author Richard Parkins extracted from QueryEditorDialog + * also used in FindDialog + */ +class TermsTabWidget : public QWidget, public Ui::TermsTabWidget +{ + Q_OBJECT + + public: + /*! + * @brief Creates the terms tab. + * @param parent The parent widget. + */ + TermsTabWidget(QWidget * parent = 0); + + QStringList m_columnList; + + private: + void paintEvent(QPaintEvent * event); + + private slots: + void moreTerms(); + void lessTerms(); + void relationsIndexChanged(const QString &); +}; + +#endif //TERMSTABWIDGET_H diff --git a/Sqliteman/sqliteman/termstabwidget.ui b/Sqliteman/sqliteman/termstabwidget.ui new file mode 100644 index 0000000..bc7f149 --- /dev/null +++ b/Sqliteman/sqliteman/termstabwidget.ui @@ -0,0 +1,106 @@ + + + TermsTabWidget + + + + 0 + 0 + 333 + 222 + + + + + 0 + 0 + + + + Select Terms + + + + + + + 0 + 0 + + + + Match all of the following terms + + + true + + + + + + + + 0 + 0 + + + + Match any of the following terms + + + + + + + + 1 + 1 + + + + + 200 + 100 + + + + + + + + + + Qt::Horizontal + + + + 284 + 20 + + + + + + + + More + + + + + + + false + + + Less + + + + + + + + + +