Skip to content

Commit

Permalink
Split out the file and fqn selection methods into their own secti…
Browse files Browse the repository at this point in the history
…ons (#4083)

### 🎩 Previews
- [The "file"
method](https://docs-getdbt-com-git-dbeatty-split-file-fqn-dbt-labs.vercel.app/reference/node-selection/methods#the-file-method)
- [The "fqn"
method](https://docs-getdbt-com-git-dbeatty-split-file-fqn-dbt-labs.vercel.app/reference/node-selection/methods#the-fqn-method)

## What are you changing in this pull request and why?

The `file` and `fqn` selections methods are distinct from each other,
but they've been documented within the same section. They deserve their
own sections, just like the rest of the methods.

### History

The `fqn` method was undocumented for some amount of time, and #1851
added the initial documentation.

### On con
- If anyone has a hyperlink that is using the previous anchor, it will
no longer go to that same section.

i.e., this will no longer exist:
-
https://docs.getdbt.com/reference/node-selection/methods#the-file-or-fqn-method

Instead, it will be split into these two:
-
https://docs.getdbt.com/reference/node-selection/methods#the-file-method
-
https://docs.getdbt.com/reference/node-selection/methods#the-fqn-method

But #1851 would have had the same issue (but in reverse), so in a sense,
we'd be just returning to the anchor that was in use previously.

Side note: there might be some way to override the value of the anchor
if we wanted it to be different than the default.

My recommendation is to just leave this PR as-is (without messing with
the auto-generated anchors).

## Checklist

- [x] Review the [Content style
guide](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/content-style-guide.md)
and [About
versioning](https://github.com/dbt-labs/docs.getdbt.com/blob/current/contributing/single-sourcing-content.md#adding-a-new-version)
so my content adheres to these guidelines.
  • Loading branch information
mirnawong1 authored Sep 18, 2023
2 parents b0b84b5 + 7fdb386 commit 1e26869
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions website/docs/reference/node-selection/methods.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,19 +74,28 @@ selectors unambiguous.

<VersionBlock firstVersion="1.2">

### The "file" or "fqn" method
The `file` or `fqn` method can be used to select a model by its filename, including the file extension (`.sql`).
### The "file" method
The `file` method can be used to select a model by its filename, including the file extension (`.sql`).

```bash
# These are equivalent
dbt run --select file:some_model.sql
dbt run --select some_model.sql
dbt run --select some_model
dbt run --select fqn:some_model # fqn is an abbreviation for "fully qualified name"
```

</VersionBlock>

### The "fqn" method

The `fqn` method is used to select nodes based off their "fully qualified names" (FQN) within the dbt graph. The default output of [`dbt list`](/reference/commands/list) is a listing of FQN.

```
dbt run --select fqn:some_model
dbt run --select fqn:your_project.some_model
dbt run --select fqn:some_package.some_other_model
```

### The "package" method

The `package` method is used to select models defined within the root project
Expand Down

0 comments on commit 1e26869

Please sign in to comment.