home User Guide Getting Started Help Center Documentation Community Training Certification
Looker keyboard_arrow_down
language keyboard_arrow_down
Looker documentation will be moving to cloud.google.com in mid-2022!
All the information you rely on will be migrated and all docs.looker.com URLs will be redirected to the appropriate page.
Generating a model

This page provides the steps to create a new project and automatically generate a basic model from your database.

There are other options for creating your project files: you can create a blank project and manually create its model, or to clone an existing public Git repository, see the Creating a new LookML project documentation page.

Automatically generating a model from your database

  1. Click on Develop in the menu bar and verify that you are in Development Mode.

2. Select Projects from the Develop menu:

  1. From the LookML Projects page, click New LookML Project:
    • The LookML Projects page lets you view all of your projects along with their respective models. You use this page to create, view, and configure your projects.

  1. In the New Project dialog, specify the options for your project:
    • Give your project a name.
    • For Starting Point, choose Generate Model from Database Schema.
    • From the Connection drop-down menu, select the name of your database connection.
    • From Build Views From, select an option:
      • All Tables: The LookML generator creates a view file for each table in your database.
      • Single Table: The LookML generator creates a view for one table in your database. If you choose this option, enter the name of the database table.
    • To generate files for only one schema in your database, enter the name of the schema in the Schemas text field. You can list multiple schemas, separated by commas.
    • To leave table prefixes out of your view filenames, enter your database’s prefixes in the Ignore Prefixes text field. This field is case-sensitive. You can list multiple prefixes, separated by commas. For example, your tables are titled dwh_orders and DBS_users. If you enter dwh, DBS in the Ignore Prefixes text field, then Looker creates view files named orders and users.
  2. Click Create Project.

    • The LookML generator creates one model file for the project, and a view file for each table in the database (unless otherwise specified). Then, Looker opens the new project in the Looker IDE.
    • The LookML generator creates IDE folders for your view and model files. If your database has more than one schema, the LookML generator creates a folder for schemas.

For BigQuery connections, if you generate a LookML project from your database, Looker autopopulates field descriptions with the descriptions from your BigQuery column metadata, if any.

The generator also creates an Explore for each database table. To start querying your data, use the Explore menu to select the name of an Explore. If your admin has enabled the Enhanced Navigation Labs feature, select the Explore option from the new enhanced left navigation panel. See the Exploring data in Looker documentation page for more information.

To rename your project after you’ve created it, see the Renaming a project section of the Accessing and editing project information documentation page.

You can manually create additional new models for your project as described on the Understanding model and view files documentation page, configure them for use in production as discussed in the When you need to configure models section on this page, and find further instructions on the Creating a new LookML project documentation page.

After your model files are generated or manually created, see the Setting up and testing a Git connection documentation page for information on connecting your Looker project to Git. You can record changes to your LookML files and manage versions of your files.

Improved LookML generation

If your Looker admin has enabled the Improved LookML Generation Labs feature, Looker adds additional elements to your project when you generate the project from your database:

When you need to configure models

Configuring a model is useful for the following reasons:

A model configuration is not needed for admins (or developers with the manage_models permission) while they are in Development Mode. This lets LookML developers work easily while in Development Mode. However, if a model configuration does exist, any queries are constrained by that configuration even in Development Mode.

Although a LookML developer specifies the desired connection in the model file, an admin controls what connections are allowed on the LookML Projects page. If a model specifies using a connection that is not allowed in the model’s configuration, then the connection is not allowed.

A model must have a configuration in the following scenarios:

For developers without the manage_models permission, admins can limit access to certain connections by limiting the developers to particular model sets and limiting the connections allowed for those models.

Looker lets developers who have the manage_models permission run queries on an unconfigured model in Development Mode. Looker does this by searching projects for a model with that name. The first model found with that name is used to run the query.