Go to Scriptcase store

# Interbase connection with PDO Firebird

In Scriptcase, we have the following driver available for Interbase connections: PDO Firebird. If you are using your own pre-configured environment, Interbase extensions must be enabled manually in PHP.

## Prerequisites

If you are using a manual installation on Linux, you will need to install the php extension for Firebird. See below for how to do this.

1 - Log into your Linux terminal and type this line below according to your operating system to install the Firebird PDO Firebird driver.

Ubuntu/Debian | CentOS
--- | ---
`sudo apt-get install php8.1-interbase` | `sudo yum install php-interbase`

2 - Check if the PDO Firebird driver is enabled in your Scriptcase diagnostic. Here is how to locate your diagnostics and verify that the driver is enabled.

- When you access the top menu Help > Diagnostics, you can easily find it through the interface.

- Or, by accessing your Scriptcase installation path:

`127.0.0.1/scriptcase/diagnosis.php` or `domain.com/scriptcase/diagnosis.php`

## Creating a connection in Scriptcase

Here’s how to create a connection in your Scriptcase project using the Firebird database.

1 - Access any project from your Scriptcase.

2 - Click on the New connection icon to create a connection.

or go to the Database > New Connection menu.

After that a new page will appear with all the database connections.

3 - Select the Firebird connection.

### Connection

Enter the parameters for connecting to your Firebird database as follows:

- Connection Name: Set the name of your new connection. By default, Scriptcase adds the prefix conn along with the database name.

- DBMS Driver: Select the Firebird Driver used to connect. In this example we use the Firebird PDO Driver.

- Server/Host (Name or IP): Enter the IP or domain of the server where the database is installed.
  - Ex: `serverdomain.com` or `192.168.254.170`.
- Port: Enter the numeric port for your database server.
  - Ex: `3050`

- Database Name: Enter the database created for use by the entered user.

- Username: Enter the user to authenticate the connection to your Firebird database.

- Password: Enter the password to complete the authentication process.

- Test Connection: Click this button to get a response from Scriptcase request to know if the entered parameters are correct.

### Filter

By accessing this tab, you can configure which items from the Database will be displayed in the connection, depending on the owner or not.

#### Show

Allows the Firebird connection to see tables, views, system tables and procedures depending on the items selected by the user. By default, the items Tables and Views are already selected by Scriptcase.

- Tables: By selecting this option, the tables in your database will be displayed.
  - By default, Scriptcase enables this option.
- Views: Selecting this option will display your database views.
  - By default, Scriptcase enables this option.

- System tables: By selecting this option, the system tables of your database will be displayed.

- Procedures: When you select this option, the procedures from your database will be displayed.

#### Searches

Allows you to define which tables and owners are displayed.

- Tables: You can define in this option which tables are displayed. The setting can contain a `PREFIX%` or name of the tables to be displayed.
  - By default, Scriptcase leaves this option empty.
  - Ex:

- Owner: Inform the user who sees the inserted tables for display.
  - User must be in capital letters, as in the example above.
- Show: Choose whether tables are displayed for the owner entered.

> NOTE: By using table filtering, you eliminate unnecessary tables for your project and improve the performance of your database connection.

### Advanced

In this tab, you have access to connection-specific settings. Changes made in this section impact the data display and performance of the application.

#### Charset

Select the encoding used in your database.

#### Role

Defines the user role for the database session. Roles are used to manage permissions and access control within Firebird.

You can set more than one role for the user separating them by using the “;”

#### Dialect

Determines the SQL dialect used in the connection. Firebird supports different dialects (1, 2, or 3), which affect SQL syntax and behavior.

If the option in the database is set to 2, it doesn’t matter what option you choose in this field.

- Options:
  - Empty - Gets the default from the database.
  - 1 - Old version of Firebird (1.5) > Does not support timestamp, Numeric or Decimal
  - 2 - Version with timestamp support
  - 3 - Version - Newer versions (Case sensitive and compatible with Firebird 2.5, 3 and 4)

#### Decimal Separator

Select the separator type for decimal records, between comma and period.

- By default, period `.` is selected as the separator.

#### Persistent connection

Set whether connections will be closed after your scripts run in Scriptcase applications.

- By default, Scriptcase disables this option.

#### Use schema before table name

Set whether the database schema is displayed before table names.

- By default, Scriptcase enables this option.

  - Ex:

### SSH

Here are the SSH options available in the image and their descriptions regarding database connection:

#### Use SSH

Enables or disables the SSH tunnel for database connection. When enabled, the database connection will be routed through the SSH server.

#### SSH Server

The IP address or hostname of the SSH server that will be used for tunneling. This is the machine that will act as a bridge to access the database securely.

#### SSH Port

The port used to connect to the SSH server.

#### SSH User

The username used to authenticate with the SSH server. This user must have permissions to establish an SSH connection.

#### Authentication method

You can choose two options: password or certificate. When you choose one of the options, a new field will appear below for the configuration.

#### Private cert. file

The private key file used for authentication if the SSH server requires key-based authentication instead of a password.

#### Local port for port forwarding

The local port on the client machine that will be used for forwarding database traffic through the SSH tunnel. This port acts as a bridge between the database client and the remote database.

#### Database server from SSH

The hostname or IP address of the database server as seen from the SSH server. This is necessary when the database is only accessible within the SSH server’s network.

#### Database port from SSH

The port of the database server that will be accessed through the SSH tunnel. This should match the database service’s listening port.