The Connections page lists all of the database connections that you have configured for Looker use.
This page shows basic information about the connections you’ve defined and lets you test the status of those connections:
|Name||The name of the connection, chosen by you, that is used in the
|Host:Port||The host path where your database is located, and the port that Looker will use to connect to that host.|
|Username||The username that Looker will use to connect to the database.|
|Database||The name of the database that Looker will query when using this connection.|
|SSL||Whether or not you are using SSL encryption to protect the data traveling between Looker and your database (please note there are other secure options that are not SSL).|
|Type||The SQL dialect of the database connection.|
|Actions||Actions you can take for a connection: test a connection, edit a connection, view other information about a connection, jump to a list of links to the connection’s Explores, or delete a connection.|
Looker lets you test your connections to make sure they are functioning properly. Each connection test includes a list of status checks to tell you whether or not Looker can successfully use the database connection. For example:
Potential issues are shown in yellow, while errors are shown in red.
You can check the status of:
- A single connection by clicking Test to the far right of that connection.
- All connections by clicking the Test All Connections button at the top of the page.
Two checks are common cause for confusion:
- Can find temp schema
- Can use persistent derived tables
These checks do not need to pass in order for Looker to function. However, you will need them to pass in order to use persistent derived tables, which are a very valuable modeling feature.
To add a connection, click the New Database Connection button in the upper left of the page. Looker displays the Connections Settings page:
The fields Looker displays depends on your dialect setting.
For more information about applying user attributes to connection settings, see the “Connections” section of the User Attributes page.
For more information about using the PDT Overrides column to configure separate login credentials for PDT processes, see this section.
The following options may be available for configuration, depending on your SQL dialect:
The name of the connection as you want to refer to it. You should not use spaces. This value does not need to match anything in your database, it is just a label that you assign. You’ll use it in the
connection parameter of your LookML model.
The SQL dialect that matches your connection. It’s important to choose the correct value so that you are presented with the proper connection options, and so Looker can translate your LookML into SQL properly.
Host : Port
Your database host name, and the port that Looker should use to connect to your database host.
If you apply a user attribute to the Host field, the user attribute cannot have a user access level set to Editable.
The name of the database on your host. For example, you might have a host name of
my-instance.us-east-1.redshift.amazonaws.com on which there is a database called
sales_info. You would enter
sales_info in this field. If you have multiple databases on the same host, you may need to create multiple connections to use them (with the exception of MySQL, in which the word “database” means something a little bit different than most SQL dialects).
The username that Looker should use to connect to your database. You should configure the user ahead of time according to the instructions in our database configuration instructions.
The password that Looker should use to connect to your database. You should configure the password ahead of time according to the instructions in our database configuration instructions.
The default schema that Looker uses when a schema is not specified. This includes when using SQL Runner, during LookML project generation, and when querying tables.
Persistent Derived Tables
Check this box to enable persistent derived tables. This reveals the Temp Database field and the PDT Overrides column. Looker displays this option only if the database dialect you chose supports using PDTs.
Though labeled “temp database”, you’ll enter either the database name or schema name — as appropriate for your SQL dialect — that Looker should use to create persistent derived tables. You should configure this database or schema ahead of time, with the appropriate write permissions. On the Database Configuration Instructions page, select your database dialect to see the instructions for that dialect.
You can include additional JDBC parameters for your queries here, if needed.
If you want to use a user attribute in a JDBC parameter, you can use liquid templating. The syntax is
PDT and Datagroup Maintenance Schedule
This setting accepts a cron expression that indicates when Looker should check datagroups and persistent derived tables (that are based on
sql_trigger_value) to be regenerated or dropped. The default value of
*/5 * * * * means “check every 5 minutes”.
For additional details, read this User Forum topic about this feature.
Choose whether or not you want to use SSL encryption to protect data as it passes between Looker and your database. SSL is only one option that can be used to protect your data; other secure options are described here.
Here you can set the maximum number of connections that Looker can establish with your database. For the most part, you are setting the number of simultaneous queries that Looker can run against your database. You should set this value carefully. If it is too low, queries may be slow for your users as they wait for other user’s queries to return. If it is too high, you may overwhelm your database. The default value (which varies depending upon your SQL dialect) is typically a reasonable starting point.
Most databases also have their own settings for the maximum number of connections they will accept. You should check to see that Looker is set equal to or lower than your database’s configuration.
Connection Pool Timeout
If your users do request more connections than the Max Connections setting, the requests will wait for others to finish before they are executed. The maximum amount of time that a request will wait is configured here. You should set this value carefully. If it is too low, users may find their queries get cancelled because there isn’t enough time for other user’s queries to finish. If it is too high, large numbers of queries may build up causing users to wait for a very long time. The default value is typically a reasonable starting point.
SQL Runner Precache
In SQL Runner, all table information is pre-loaded as soon as you select a connection and schema. This enables SQL Runner to quickly display table columns as soon as you click on a table name. However, for connections and schema with many tables or with very large tables, you may not want SQL Runner to pre-load all of the information.
If you prefer SQL Runner to load table information only when a table is selected, you can uncheck the SQL Runner Precache option to disable SQL Runner pre-loading for the connection.
Database Time Zone
The time zone in which your database stores time information. Looker needs to know this so that it can convert time values for users, making it easier to understand and use time-related data. Users can use their preferred time zone in filter values and view query results converted to their preferred time zone.
Time data is converted depending on how these options are set:
- If the User Specific Time Zone setting is enabled, then:
- Users can have a default time zone set by the Looker admin or by themselves. If the user does not have a time zone configured for their account, Looker will default to the Application Time Zone.
- Users can override their default time zone when exploring their own queries, viewing dashboards or viewing Looks.
- If User Specific Time Zones are disabled, then Looker converts time values in filter values and query results from the Database Time Zone to the Query Time Zone.
Looker’s ability to provide time zone conversion depends on the database dialect’s ability to support this functionality. The list below shows which dialects support time zone in the most recent Looker release:
Query Time Zone
The Query Time Zone option is visible only if you have disabled User Specific Time Zones.
When User Specific Time Zones are disabled, the Query Time Zone is the time zone that is displayed to your users when they pull time data, and the time zone into which Looker will convert time data from the Database Time Zone.
Configuring Separate Login Credentials for PDT Processes
If your database supports persistent derived tables, and you have checked the Persistent Derived Tables box in the connection settings, Looker displays the PDT Overrides column. In the PDT Overrides column, you can enter separate JDBC parameters (host, port, database, username, password, schema, and additional parameters) that are specific to persistent derived table (PDT) processes. This can be valuable for a number of reasons:
- By creating a separate database user for PDT processes, you can use PDTs in your model even if you assign user attributes to your database login credentials.
- PDT processes can authenticate through a separate database user, with a higher priority. This way the database can prioritize the PDT jobs over less-critical user queries.
- Write access can be revoked for the standard Looker database connection, and only granted to a special user that PDT processes will use for authentication. This is a better security strategy for most organizations.
- For databases like Snowflake, PDT processes can be routed to more powerful hardware that is not shared with the rest of the Looker users. This way PDTs can build quickly without incurring the cost of running expensive hardware full-time.
For example, the configuration below shows a connection where the username and password fields are set to user attributes. This way, each user can access the database using their individual credentials. The PDT Override column creates a separate user (
pdt_user) with its own password. The
pdt_user account will be used for all PDT processes, with access levels appropriate to PDT creation and update:
In most cases, we recommend that you write your PDTs to the same database as your default connection. It is possible to use the PDT Overrides column to configure PDT processes to write to a separate database. However, if the PDTs are not visible to your default connection, you won’t be able to query them.
To edit an existing connection, click the Edit button to the far right of a connection. You’ll be brought to same page that you use to create a connection (described above), but with the relevant information already filled out. Make any changes you need to, then click Update Connection.
Other Connection Options
You’ll notice there is also a gear dropdown menu to the far right of a connection. It offers the following options:
This option brings you to a Looker explore page that lets you create Looker reports based on the metadata of your connection. Although this option begins with the schema name, table name, and column count selected, you can manipulate it just like any other Looker report.
This option brings you to a Looker explore page that lets you create Looker reports based on the metadata of your connection. Although this option begins with the schema name, catalog name, table count, and column count selected, you can manipulate it just like any other Looker report.
This option brings you to a Looker explore page that lets you create Looker reports based on the processes running on this connection, the state they are in, how long they have been running, and other info. This can be useful in helping determine the cause if Looker is running slow, or if a query is not running at all.
Show PDT Event Log
This option brings you to a Looker explore page that lets you create Looker reports based on the derived table activity for this connection. The available fields are described in more detail on our PDTs page.
This option brings you to Looker’s SQL Runner, with the proper connection and schema already selected.
This option brings you to a list of basic, automatically generated Explore options for your connection. These are not based on your customized data models, but they enable some quick reporting on the raw data in your connection’s tables. This is typically only useful for getting an idea of table contents before modeling, rather than for actual data analysis purposes.
To delete an existing connection, click the gear dropdown menu to the far right of a connection and select Delete. You’ll be given the opportunity to confirm the deletion but, once you do so, it cannot be undone. Accidentally deleting a connection will disable any queries that use it. However, as long you re-create a new connection with the same name, functionality will be restored.