App-DBBrowser
view release on metacpan or search on metacpan
bin/db-browser view on Meta::CPAN
=back
When the I<mouse> option is enabled, you can use the left mouse key to navigate through the menus.
To confirm a chosen menu item, use the C<Return> key.
In some submenus, it is possible to select more than one item before pressing C<Return> (e.g., the input filters
I<Choose Rows> and I<Choose Cols>); in such submenus, the list of items marked with the C<SpaceBar> is added to the
chosen items when C<Return> is pressed. If the mouse mode is enabled, you can use the right mouse key instead of the
C<SpaceBar>. Pressing C<Ctrl-SpaceBar> inverts the made choices - for example, to select all but one, select the one
with the C<SpaceBar> and then press C<Ctrl-SpaceBar>.
=head2 Read-line
=over
=item *
Use C<BackSpace> or C<Strg-H> to delete the character behind the cursor and C<Delete> to delete the character at the
cursor.
=item *
Press C<Strg-U> to delete the text backward from the cursor to the beginning of the line and C<Strg-K> to delete the
text from the cursor to the end of the line.
=item *
Use C<Right-Arrow> to move forward a character and C<Left-Arrow> to move back a character.
=item *
Press C<Page-Up> to move back 10 characters and C<Page-Down> to move forward 10 characters.
=item *
Use C<Home> or C<Strg-A> to move to the start of the line and C<End> or C<Strg-E> to move to the end of the line.
=back
Some C<read-line>s have predefined values. You can access these values with the C<Up-Arrow> and C<Down-Arrow> keys.
To exit a C<read-line> without returning anything, press C<Ctrl-X>. When the input buffer is empty and C<Enter> is
pressed, C<read-line> returns an empty string.
=head1 OUTPUT
The elements are right-justified if they look like a number; otherwise, they are left-justified.
If the option I<squash_spaces> is enabled, leading and trailing spaces are removed from the elements, and spaces are
squashed to a single white space.
Tab characters (C<\t>) are replaced with a space.
Vertical spaces (C<\v>) are squashed to two spaces.
Control characters, code points of the surrogate ranges and non-characters are removed.
See also the option group L</Output>.
C<Ctrl-F> opens a prompt. A regular expression is expected as input. This enables one to display only rows where at
least one column matches the entered pattern. See option L</Search>.
=head1 MENUS
=head2 Plugins Menu
Choosing a plugin leads to the I<Databases Menu>.
(If there is only one plugin, the plugins menu is not shown, but the plugin is chosen automatically.)
=head2 Databases Menu
Choosing a database leads to the I<Schemas Menu>.
(If there is only one database, the databases menu is not shown, but the database is chosen automatically.)
=head2 Schemas Menu
Choosing a schema leads to the I<Tables Menu>.
(If there is not more than one schema, the schemas menu is not shown, but the schema is chosen automatically.)
=head2 Tables Menu
The menu entries of the tables menu:
=head3 Prompt Line
Selecting the prompt line (the database name) opens a menu with these entries:
=over
=item
Create Table
=item
Drop Table
=item
Create View
=item
Drop View
=item
Attach DB
=item
Detach DB
=back
For I<Create Table>, I<Drop Table>, I<Create View> and I<Drop View>, see L</WRITE ACCESS>.
These entries are available if enabled in L</Extensions>.
I<Attach DB> is available for C<SQLite> databases. I<Attach DB> can be used to attach databases to the current database.
=head3 Tables Entries
Choosing one of the tables leads to the I<SQL Menu>.
=head3 Subquery
I<Subquery> is available if enabled in L</Extensions>.
Enter a subquery and use it as a table.
The query can be created in different ways:
=over
=item SQL Menu
Build the query with the SQL Menu.
Before returning the subquery, the result of the subquery can be displayed by selecting the prompt line of the menu.
This does not work if the subquery is a correlated subquery.
=item Readline
Write the query in the prompt.
=item Stored Queries
If stored queries are available, it is possible to select one of those queries.
There are three different types of stored queries:
- permanently saved queries
- previously entered queries
- queries printed with I<Print TABLE>
Queries can be saved permanently by selecting the prompt line (I<Choose:>) in the I<Subquery> menu.
=back
=head3 CTE
Common table expression, available if enabled in L</Extensions>.
=over
=item New CTE
The user is asked for the CTE query and the CTE name.
The syntax of the CTE name is:
[RECURSIVE] cte_name [(col_name [, col_name] ...)]
L<Subquery> above describes how to build/enter the query.
=item Available CTEs
Select from the built CTEs.
=item Remove
Remove CTEs.
=back
=head3 Join
Join tables.
This entry is available if enabled in L</Extensions>.
=head3 Union
Combine the result from multiple C<SELECT> statements with C<Union>, C<Intersect> and C<Except> (C<Firebird>: Union).
This entry is available if enabled in L</Extensions>.
=head2 SQL Menu
SQL statements are created in this menu.
The SQL Menu has the following menu entries:
=head3 Prompt Line
Selecting this prompt line (I<Customize:>) opens a menu with these entries:
=over
=item
Insert
=item
Update
=item
Delete
=back
See L</WRITE ACCESS>. These entries are available if enabled in L</Extensions>.
=head3 BACK
If the user has set substatements, selecting C<BACK> will reset all changes made.
If no changes have been made or if the changes have been reset, selecting C<BACK> will exit the SQL menu.
=head3 Print TABLE
Select I<Print TABLE> to show the result of the formed statement on the screen.
=head3 The Sub-Statements Entries
In a SQL submenu (e.g., C<WHERE>), the back arrow resets the subquery step by step. With no items left, the SQL submenu
is left when the back arrow is chosen.
To activate the aggregate mode, enter the GROUP BY submenu and press C<-OK-> (with or without selecting GROUP BY
columns).
See also L</Extensions> and L</Operators>
=head4 SELECT
Choose the required columns for the C<SELECT> substatement.
It is possible to add many columns at once by marking them with the C<SpaceBar> key. If columns are marked with the
C<SpaceBar>, the highlighted column is not added to the chosen when C<Return> is pressed.
When aggregate mode is active, the user can select from the available aggregate functions C<AVG>, C<COUNT>, C<COUNT(*)>,
C<GROUP_CONCAT>, C<MAX>, C<MIN>, C<SUM> and the added GROUP BY columns.
=head4 DISTINCT
=head4 WHERE
=head4 GROUP BY
Selected GROUP BY columns are added automatically to the selected columns.
=head4 HAVING
=head4 ORDER BY
=head4 LIMIT
=head4 OFFSET
=head3 Export
Export the result of the chosen SQL statement to a C<CSV>-file. See options L</Export Data>.
=head1 WRITE ACCESS
=head2 Create/Drop Table/View
I<Create/Drop Table/View> can be accessed by selecting the prompt-line in the L</Tables Menu> if the respective option
is activated.
Selecting the prompt line of the I<Create/Drop Table/View> submenu allows you to set the parse settings described in
L</Import Data>.
=head3 Create Table
If the option I<Source Type> is set to I<menu>, selecting I<Create Table> opens a submenu where you can choose the type
of the data source. If I<Source Type> is set to I<plain> or I<file>, the set data source type is automatically used
without displaying a menu. For more information, see L</Data Input>.
You will be asked:
=over
=item
for the table name
=item
if the first data row should be used as a header (Selecting the prompt line of this menu allows you to set the
L</Create-Table> options)
=item
if an auto increment column should be added (if the option is enabled in L</Create-Table>)
=item
to edit the column names
=item
to edit the column data types
=item
to confirm the creation of the table
=back
=head3 Drop Table
Dropping a table displays the entire table before confirming the deletion.
=head3 Create View
Before creating a view, print the required select statement to make it available in the subquery menu.
=head3 Drop View
Drop a view. The entire view is shown before the user confirms dropping it.
=head2 Insert/Update/Delete
I<Insert>, I<Update> and I<Delete> can be accessed by selecting the prompt-line in the L</SQL Menu> if the respective
option is activated.
I<Delete>, I<Update>, or I<Insert> may not be available with C<Join> and C<Union>/C<Intersect>/C<Except> statements.
=head3 Insert
If the option I<Source Type> is set to I<menu>, selecting I<Insert> opens a submenu where one can choose the type of
the data source. If I<Source Type> is set to I<plain> or I<file>, the set data source type is used without showing a
menu. For more information, see L</Data Input>.
If the first column of a table is an auto-increment column, the C<INSERT INTO> statement is built without this first
column. This feature is available if supported by the database plugin.
=head3 Update
Update records. The affected (and not yet updated) records are shown before the user confirms the update.
=head3 Delete
Delete records. The affected records are shown before the user confirms the deletion.
=head2 Data Input
=head3 Data Source
=over
=item plain
I<Create Table>: First, enter the column names (any empty fields will be ignored; see also L</Max Cols Plain>). Then,
insert the data cell by cell.
I<Insert>: Insert the data cell by cell.
=item file
The data is read from a chosen file.
Supported file formats: text files and file formats supported by L<Spreadsheet::Read>. C<Spreadsheet::Read> uses
different parser modules for the different file formats - see L<Spreadsheet::Read/DESCRIPTION>. The parser modules are not
installed automatically. It is up to the user to install the required parser modules.
Selecting I<file> opens the I<Source directory> submenu where one can choose the directory which should be
searched for files.
If the L</Directory History> is set to C<1>, the I<Source directory> submenu is skipped and the directory is chosen
automatically.
After a directory has been chosen, a submenu is opened where one can choose the source file.
Selecting the prompt line of the I<Files> submenu (I<Choose a File:>) allows one to set the parse settings described in
L</Import Data>.
After the data has been read, the user can apply different input filters (See L</Input Filters>).
=back
=head3 Input Filters
=over
=item Choose Cols
Use only selected columns of the imported data.
If a column is completely empty, the header is temporarily named C<-->. If a column has no header name but contains
data, the header is temporarily named C<tmp>.
=item Choose Rows
Use only selected rows of the imported data.
=item Range Rows
Use only ranges of rows.
=item Row Groups
If the input has rows with different numbers of columns, I<Row Groups> sorts rows with the same number of columns into a
group. The user can then choose one or more groups of rows. There is only one group if all rows have the same column
count.
=item Empty Rows
This filter has two menu entries:
Remove completely empty rows (Removes rows with no values at all).
Remove rows with all fields empty or undefined (Includes completely empty rows).
=item Empty Columns
This filter has two menu entries:
Remove completely empty columns. (Columns with all rows empty or undefined)
Remove columns without data. (Columns where a header may exist, but all data rows are empty or undefined)
=item Remove Cell
Remove a cell from a chosen row.
=item Insert Cell
Insert a cell in a chosen row. The new cell is inserted in front of a chosen cell.
=item Append Col
Append an empty column. Appends a header element to the header row and adjusts the remaining rows to the length of the
header row. If the input has rows with different numbers of cells, use the I<Row Group> filter first to select the right
row-group.
=item Split Column
Item | length/width/height Item | length | width | height
------|--------------------- -----|--------|-------|------
423 | 40/30/25 423 | 40 | 30 | 25
------|--------------------- -----|--------|-------|------
64 | 80/60/30 64 | 80 | 60 | 30
------|--------------------- -----|--------|-------|------
705 | 50/50/40 705 | 50 | 50 | 40
=item Search & Replace
I<s/Pattern/Replacement/Modifiers>
Remove all commas: C<s/,//g>
id | num id | num
---|------------- ---|-----------
1 | 78,975.17 1 | 78975.17
---|------------- ---|-----------
2 | 1,040,745.87 2 | 1040745.87
---|------------- ---|-----------
3 | 3,129,818.21 3 | 3129818.21
Supported L<modifiers|https://perldoc.perl.org/perlre#Modifiers>: C<imnsxage>.
In the replacement, the variable C<$c> can be used as a counter. C<$c> is set to C<0> before each C<s///>.
By selecting the prompt line (I<Your choice:>), one can save I<search & replace> instructions for later use.
If a I<search & replace> has altered the first row of the input data, a menu entry named C<RESTORE header row> is
offered.
=item Convert DateTime
Convert a I<DateTime> to another format or to seconds since the Unix epoch.
id | date_time id | date_time
---|---------------------------- ---|--------------------
1 | Sat 13 Aug 2022 07:38:49 PM 1 | 2022-08-13 19:38:49
---|---------------------------- ---|--------------------
2 | Mon 15 Aug 2022 12:08:54 PM 2 | 2022-08-15 12:08:54
---|---------------------------- ---|--------------------
3 | Tue 16 Aug 2022 09:56:13 AM 3 | 2022-08-16 09:56:13
=item Split Table
y | factor | y | factor y | factor
----|--------|----|-------- ---|-------
62 | 8975.1 | 64 | 9986.5 62 | 8975.1
----|--------|----|-------- ---|-------
63 | 9745.8 | 65 | 9782.7 63 | 9745.8
---|-------
y | factor
---|-------
64 | 9818.2
---|-------
65 | 9986.5
=item Merge Rows
Month | Average | Average Month | Average MinTemp | Average MaxTemp
-------|---------|--------- ------|-----------------|----------------
| MinTemp | MaxTemp Jan | 9 | 22
-------|---------|--------- ------|-----------------|----------------
Jan | 9 | 22 Feb | 10 | 23
-------|---------|---------
Feb | 10 | 23
I<Merge Rows> can be used to edit a row by selecting only one row.
=item Join Columns
Item | length | width | height Item | length/width/height
------|--------|-------|-------- -----|-------------------
423 | 40 | 30 | 25 423 | 40/30/25
------|--------|-------|-------- -----|-------------------
64 | 80 | 60 | 30 64 | 80/60/30
------|--------|-------|-------- -----|-------------------
705 | 50 | 50 | 40 705 | 50/50/40
I<Join Columns> can be used to edit a column by selecting only one column.
=item Fill up Rows
If the input table rows have different numbers of cells, this filter appends empty cells to the rows until the cell
count of each row is equal to the cell count of the row with the highest cell count.
bin/db-browser view on Meta::CPAN
=item Join
=item Union
=back
=head3 Join Menu
=over
=item Subquery
=item CTE
=back
=head3 Union Menu
=over
=item Subquery
=item CTE
=item Where
=item Parentheses
=back
Note: Parentheses are not available in C<SQLite> and C<Firebird>.
These settings are also valid when C<Intersect> or C<Except> is used.
=head3 Columns and Values
=over
=item
Extended Columns
If enabled, C<%%> is shown as an additional menu entry in the column menus. Selecting C<%%> lets one choose between the
available extensions.
=item
Extended Values
If enabled, then - in addition to constants - subqueries, functions and more (see the following list) are available for
the right side of operators. Places where extended values are available: C<WHERE>, C<HAVING>, C<SET> in update, and
C<WHEN>, C<THEN> and C<ELSE> in case expressions.
=item
Extended Arguments
If enabled, subqueries, functions and more (see the following list) are available for entering arguments in addition to
constants in the scalar and window functions.
This option can also be enabled later in the functions menu by selecting the prompt line.
=back
=head4 Column/Value/Argument Extensions
Not all of these extensions are available everywhere.
=over
=item Value
Enter a constant value.
If the data type is numeric or undefined and the literal looks like a number, it is not enclosed in quotation marks.
In all other cases, the literal is enclosed in quotation marks.
C<SQLite>: If the option C<sqlite_see_if_its_a_number> is enabled, values that look like numbers are not enclosed in
quotation marks; otherwise, they are.
To enter a value quoted manually, use the C<SQL> menu entry from the C<%%> menu.
=item SQL
Selecting C<SQL> opens the subqueries menu.
See L<Subquery> for the different possibilities to enter a subquery or any other SQL text.
Entries beginning with SELECT or WITH followed by a space are automatically enclosed in parentheses.
=item Scalar Functions
Selecting C<scalar()> opens the menu, where the user can choose from a list of scalar functions.
Extended arguments for scalar functions can be temporarily enabled by selecting the prompt line (I<Scalar functions:>)
of the scalar function menu.
C<DATEADD>, C<EXTRACT> and some other functions: use the keys C<Up-Arrow> and C<Down-Arrow> to choose one of the
predefined fields (in C<Value> if the extended arguments are enabled).
C<TO_EPOCH> and C<Oracle>: The argument I<Column type> can be any of the following: I<DATE>, I<TIMESTAMP> or
I<TIMESTAMP_TZ>. If the column type is I<DATE> or I<TIMESTAMP> the session timezone is used as timezone.
Scalar functions may not work with the C<ODBC> plugin.
=item Window Functions
Selecting C<win()> opens the menu, where the user can choose from a list of window functions.
=item Case Expression
Selecting C<case> opens the menu, where the user can build a C<CASE> expression.
=item Maths
Selecting C<math()> opens the menu, where the user can combine expressions with arithmetic operators.
=item Column
Selecting C<Column> opens the menu, where the user can choose a column.
By selecting C<%%> one can choose a column from a different table.
=item Set to C<NULL>
Available after the C<SET> in an C<UPDATE> statement.
=item )end
Close the IN operator parentheses.
=item mc
C<WHERE>: Use more than one column on the left-hand side of the operator.
=item skip
C<WHERE>: Skip the column and use the EXISTS or the NOT EXISTS operator.
=item Parentheses
C<WHERE>, C<WHEN> and C<HAVING>: In the C<%%> menu are also available parentheses.
=item Column Aliases
Selecting C<alias> allows the user to add, change or remove aliases for the selected columns and the current table. It
is also possible to change the table alias and rearrange the selected columns.
=back
=head3 Write Access
Enable write access - use with care.
=over
bin/db-browser view on Meta::CPAN
=item
Qualified Table Names
=item
Quote Table Names
=item
Quote Column Names and Aliases
=back
C<SQLite>: If the current database has attached databases, the use of qualified table names is enabled automatically.
C<SQLite>: Database names in SQL statements (C<ATTACH DATABASE>) are always quoted.
C<Informix>: Set the C<DELIMIDENT> environment variable to allow quoted identifiers.
=head3 View Prefix
Enter a string that should be automatically placed in front of all view names.
=head3 Other
=over
=item
Subqueries created with the 'SQL Menu': Allow editing.
When enabled, subqueries created using the 'SQL Menu' can be edited before they are used.
=item
Pg: Convert to C<text> automatically when required.
If the driver is C<Pg>: Convert columns in string functions automatically to C<text> if the datatype of the column is
not a char like datatype. If the datatype is unknown and the value looks like a number, it is also converted to C<text>.
=back
=head2 Create-Table
=head3 Enable Options
=over
=item
Auto Increment
Enabling I<Auto Increment> makes the 'auto-increment primary key' option available when creating a table.
=item
Data Type Guessing
When this option is enabled and a table is created, C<SQL::Type::Guess> is used to guess the data types. These data types
are then used as defaults when the user is prompted for data types.
=item
Encode data for type guessing
If enabled, the data passed to C<SQL::Type::Guess> is encoded.
The setting of this option can affect the size of C<max> in C<varchar(max)> if strings contain multibyte characters.
=back
=head3 Add Form Fields
=over
=item
Table Constraint Fields
Specify the number of fields available for entering table constraints (0-9).
=item
Table Option Fields
Specify the number of fields available for entering table options (0-9).
=back
=head3 Auto Increment Column Name
Set the default value for the auto-increment primary key column name.
=head2 Output
=head3 Binary Filter
Set I<Binary filter> to C<NO>, C<BNRY>, or C<Hexadecimal>.
C<NO> - print the binary data as it is
C<BNRY> - "BNRY" is printed instead of the binary data
C<Hexadecimal> - the binary data is printed in hexadecimal format
If the first 100 characters of the data match the regexp C</[\x00-\x08\x0B-\x0C\x0E-\x1F]/>, the data is considered
arbitrary binary data.
Printing unfiltered arbitrary binary data could break the output.
=head3 Squash Spaces
If I<squash_spaces> is enabled, consecutive spaces are squashed to one space, and leading and trailing spaces are
removed.
=head3 Undef String
Set the string that will be shown on the screen instead of an undefined field.
On C<MSWin32>, only single-byte character sets are supported when entering the setting I<Undef string>, I<user>,
( run in 1.171 second using v1.01-cache-2.11-cpan-6aa56a78535 )