Go to Scriptcase store

# Mac OS

In Scriptcase, we only have one driver to connect to SQLite: SQLite PDO. If you are using your own pre-configured environment, the SQLite extension must be enabled manually in PHP.

## Prerequisites

If you are using a manual installation on MacOS, you will need to install PHP and the SQLite driver will be enabled. Click here to see how to do this.

> NOTE: If you are using an automatic Scriptcase installation, the SQLite driver will be enabled automatically.

1 - Verify that the SQLite driver is enabled in your Scriptcase diagnostic. See below for how to locate your diagnostic:

- When you go to 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 is how to create a connection in your Scriptcase project using the SQLite database.

1 - Access any project from within 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 SQLite connection.

### Connection

Enter the parameters for connecting to your SQLite 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 SQLite Driver used to connect. By default, the driver will be SQLite PDO.

- Server/Host(Name or IP): Enter the full path to your SQLite database file. EX: `C:\Apache24\htdocs\client_data`

- Password: Enter the password to complete the authentication process if you have it set for your DB file.

- Test Connection: Click this button to get a response from the Scriptcase request to see if the parameters you entered 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 SQLite 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: By selecting this option, the views of your database will be displayed.
  - 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 will be 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 settings specific to the connection. Changes made in this section impact the data display and performance of the application.

- client_encoding: Select the encoding used in your database. In the example above, we used client_encoding UTF-8.

- 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 the schema before table name: Set whether the database schema is displayed before the 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.