# eric6.SqlBrowser.SqlBrowserWidget

Module implementing the SQL Browser widget.

### Global Attributes

None

### Classes

SqlBrowserWidget | Class implementing the SQL Browser widget.

### Functions

None

## SqlBrowserWidget

Class implementing the SQL Browser widget.

### Signals

statusMessage(str)
  emitted to show a status message

### Derived from

QWidget, Ui_SqlBrowserWidget

### Class Attributes

cCount

### Class Methods

None

### Methods

SqlBrowserWidget | Constructor
__deleteRow | Private slot to delete a row from the database table.
__insertRow | Private slot to insert a row into the database table.
addConnection | Public method to add a database connection.
addConnectionByDialog | Public slot to add a database connection via an input dialog.
executeQuery | Public slot to execute the entered query.
on_clearButton_clicked | Private slot to clear the SQL entry widget.
on_connections_cleared | Private slot to clear the table.
on_connections_schemaRequested | Private slot to show the schema of a table.
on_connections_tableActivated | Private slot to show the contents of a table.
on_deleteRowAction_triggered | Private slot handling the action to delete a row.
on_executeButton_clicked | Private slot to execute the entered SQL query.
on_insertRowAction_triggered | Private slot handling the action to insert a new row.
showSchema | Public slot to show the schema of a table.
showTable | Public slot to show the contents of a table.
updateActions | Public slot to update the actions.

### Static Methods

None

#### SqlBrowserWidget (Constructor)

SqlBrowserWidget(parent=None)

Constructor

parent
  reference to the parent widget (QWidget)

#### SqlBrowserWidget.__deleteRow

__deleteRow()

Private slot to delete a row from the database table.

#### SqlBrowserWidget.__insertRow

__insertRow()

Private slot to insert a row into the database table.

#### SqlBrowserWidget.addConnection

addConnection(driver, dbName, user, password, host, port)

Public method to add a database connection.

driver
  name of the Qt database driver (string)
dbName
  name of the database (string)
user
  user name (string)
password
  password (string)
host
  host name (string)
port
  port number (integer)

Returns:
  SQL error object (QSqlError)

#### SqlBrowserWidget.addConnectionByDialog

addConnectionByDialog()

Public slot to add a database connection via an input dialog.

#### SqlBrowserWidget.executeQuery

executeQuery()

Public slot to execute the entered query.

#### SqlBrowserWidget.on_clearButton_clicked

on_clearButton_clicked()

Private slot to clear the SQL entry widget.

#### SqlBrowserWidget.on_connections_cleared

on_connections_cleared()

Private slot to clear the table.

#### SqlBrowserWidget.on_connections_schemaRequested

on_connections_schemaRequested(table)

Private slot to show the schema of a table.

table
  name of the table for which to show the schema (string)

#### SqlBrowserWidget.on_connections_tableActivated

on_connections_tableActivated(table)

Private slot to show the contents of a table.

table
  name of the table for which to show the contents (string)

#### SqlBrowserWidget.on_deleteRowAction_triggered

on_deleteRowAction_triggered()

Private slot handling the action to delete a row.

#### SqlBrowserWidget.on_executeButton_clicked

on_executeButton_clicked()

Private slot to execute the entered SQL query.

#### SqlBrowserWidget.on_insertRowAction_triggered

on_insertRowAction_triggered()

Private slot handling the action to insert a new row.

#### SqlBrowserWidget.showSchema

showSchema(table)

Public slot to show the schema of a table.

table
  name of the table to be shown (string)

#### SqlBrowserWidget.showTable

showTable(table)

Public slot to show the contents of a table.

table
  name of the table to be shown (string)

#### SqlBrowserWidget.updateActions

updateActions()

Public slot to update the actions.

Up