User Guide Getting Started Help Center Documentation Community Training
New LookML
Old LookML
New LookML
Looker
  
English
日本語
connection

Usage

connection: "connection_name"

Hierarchy

connection

Default Value

None

Accepts

A string containing the name of a connection

Definition

connection specifies the database connection from which a model will retrieve data. Database connections are defined and named in Looker’s Admin settings. A model may only use one connection.

Examples

Retrieve data from the mysql_db connection for the model being used:

connection: "mysql_db"

Common Challenges

connection Must Reference a Connection Name from Looker’s Admin Settings

The connection name that is referenced by connection does not take the name of an actual database or schema. The name must be one of the connections available when configuring a model in Looker’s Admin settings.

If a Model Configuration Exists, Then connection Can Only Reference an Allowed Connection

If a Looker developer specifies a connection in the model file that is not allowed in the model configuration, then any query on that model will not run.

If a Model Configuration Does Not Exist, Then Only Certain People Can Query

If you have not been given the manage_models permission (which is included in the admin role) then the model must be configured before you can run queries on the model.

Top