-
Notifications
You must be signed in to change notification settings - Fork 969
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
24 changed files
with
327 additions
and
107 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,73 @@ | ||
--- | ||
title: "Use dbt Copilot" | ||
sidebar_label: "Use dbt Copilot" | ||
description: "Use the dbt Copilot AI engine to generate documentation, tests, and semantic models from scratch, giving you the flexibility to modify or fix generated code." | ||
description: "Use dbt Copilot to generate documentation, tests, semantic models, and sql code from scratch, giving you the flexibility to modify or fix generated code." | ||
--- | ||
|
||
# Use dbt Copilot <Lifecycle status='beta'/> | ||
|
||
Use dbt Copilot to generate documentation, tests, and semantic models from scratch, giving you the flexibility to modify or fix generated code. To access and use this AI engine: | ||
Use dbt Copilot to generate documentation, tests, semantic models, and code from scratch, giving you the flexibility to modify or fix generated code. | ||
|
||
1. Navigate to the dbt Cloud IDE and select a SQL model file under the **File Explorer**. | ||
This page explains how to use dbt Copilot to: | ||
|
||
2. In the **Console** section (under the **File Editor**), click **dbt Copilot** to view the available AI options. | ||
- [Generate resources](#generate-resources) — Save time by using dbt Copilot’s generation button to generate documentation, tests, and semantic model files during your development. | ||
- [Generate and edit code](#generate-and-edit-code) — Use natural language prompts to generate SQL code from scratch or to edit existing SQL file by using keyboard shortcuts or highlighting code. | ||
|
||
## Generate resources | ||
|
||
Generate documentation, tests, and semantic models resources with the click-of-a-button using dbt Copilot, saving you time. To access and use this AI feature: | ||
|
||
1. Navigate to the dbt Cloud IDE and select a SQL model file under the **File Explorer**. | ||
2. In the **Console** section (under the **File Editor**), click **dbt Copilot** to view the available AI options. | ||
3. Select the available options to generate the YAML config: **Generate Documentation**, **Generate Tests**, or **Generate Semantic Model**. | ||
- To generate multiple YAML configs for the same model, click each option separately. dbt Copilot intelligently saves the YAML config in the same file. | ||
|
||
4. Verify the AI-generated code. You can update or fix the code as needed. | ||
|
||
5. Click **Save As**. You should see the file changes under the **Version control** section. | ||
|
||
<Lightbox src="/img/docs/dbt-cloud/cloud-ide/dbt-copilot-doc.gif" width="100%" title="Example of using dbt Copilot to generate documentation in the IDE" /> | ||
|
||
## Generate and edit code <Lifecycle status='beta'/> | ||
|
||
dbt Copilot also allows you to generate SQL code directly within the SQL file in the dbt Cloud IDE, using natural language prompts. This means you can rewrite or add specific portions of the SQL file without needing to edit the entire file. | ||
|
||
This intelligent AI tool streamlines SQL development by reducing errors, scaling effortlessly with complexity, and saving valuable time. dbt Copilot's [prompt window](#use-the-prompt-window), accessible by keyboard shortcut, handles repetitive or complex SQL generation effortlessly so you can focus on high-level tasks. | ||
|
||
Use Copilot's prompt window for use cases like: | ||
|
||
- Writing advanced transformations | ||
- Performing bulk edits efficiently | ||
- Crafting complex patterns like regex | ||
|
||
### Use the prompt window | ||
|
||
Access dbt Copilot's AI prompt window using the keyboard shortcut Cmd+B (Mac) or Ctrl+B (Windows) to: | ||
|
||
#### 1. Generate SQL from scratch | ||
- Use the keyboard shortcuts Cmd+B (Mac) or Ctrl+B (Windows) to generate SQL from scratch. | ||
- Enter your instructions to generate SQL code tailored to your needs using natural language. | ||
- Ask dbt Copilot to fix the code or add a specific portion of the SQL file. | ||
|
||
<Lightbox src="/img/docs/dbt-cloud/cloud-ide/copilot-sql-generation-prompt.jpg" width="90%" title="dbt Copilot's prompt window accessible by keyboard shortcut Cmd+B (Mac) or Ctrl+B (Windows)" /> | ||
|
||
#### 2. Edit existing SQL code | ||
- Highlight a section of SQL code and press Cmd+B (Mac) or Ctrl+B (Windows) to open the prompt window for editing. | ||
- Use this to refine or modify specific code snippets based on your needs. | ||
- Ask dbt Copilot to fix the code or add a specific portion of the SQL file. | ||
|
||
#### 3. Review changes with the diff view to quickly assess the impact of the changes before making changes | ||
- When a suggestion is generated, Copilot displays a visual "diff" view to help you compare the proposed changes with your existing code: | ||
- **Green**: Means new code that will be added if you accept the suggestion. | ||
- **Red**: Highlights existing code that will be removed or replaced by the suggested changes. | ||
|
||
#### 4. Accept or reject suggestions | ||
- **Accept**: If the generated SQL meets your requirements, click the **Accept** button to apply the changes directly to your `.sql` file directly in the IDE. | ||
- **Reject**: If the suggestion don’t align with your request/prompt, click **Reject** to discard the generated SQL without making changes and start again. | ||
|
||
#### 5. Regenerate code | ||
- To regenerate, press the **Escape** button on your keyboard (or click the Reject button in the popup). This will remove the generated code and puts your cursor back into the prompt text area. | ||
- Update your prompt and press **Enter** to try another generation. Press **Escape** again to close the popover entirely. | ||
|
||
Once you've accepted a suggestion, you can continue to use the prompt window to generate additional SQL code and commit your changes to the branch. | ||
|
||
<Lightbox src="/img/docs/dbt-cloud/cloud-ide/copilot-sql-generation.gif" width="100%" title="Edit existing SQL code using dbt Copilot's prompt window accessible by keyboard shortcut Cmd+B (Mac) or Ctrl+B (Windows)" /> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
website/docs/docs/core/connect-data-platform/cratedb-setup.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
--- | ||
title: "CrateDB setup" | ||
description: "Read this guide to learn about the CrateDB data platform setup in dbt." | ||
id: "cratedb-setup" | ||
meta: | ||
maintained_by: Crate.io, Inc. | ||
authors: 'CrateDB maintainers' | ||
github_repo: 'crate/dbt-cratedb2' | ||
pypi_package: 'dbt-cratedb2' | ||
min_core_version: 'v1.0.0' | ||
cloud_support: Not Supported | ||
min_supported_version: 'n/a' | ||
slack_channel_name: 'Community Forum' | ||
slack_channel_link: 'https://community.cratedb.com/' | ||
platform_name: 'CrateDB' | ||
config_page: '/reference/resource-configs/no-configs' | ||
--- | ||
|
||
import SetUpPages from '/snippets/_setup-pages-intro.md'; | ||
|
||
<SetUpPages meta={frontMatter.meta}/> | ||
|
||
|
||
[CrateDB] is compatible with PostgreSQL, so its dbt adapter strongly depends on | ||
dbt-postgres, documented at [PostgreSQL profile setup]. | ||
|
||
CrateDB targets are configured exactly the same way, see also [PostgreSQL | ||
configuration], with just a few things to consider which are special to | ||
CrateDB. Relevant details are outlined at [using dbt with CrateDB], | ||
which also includes up-to-date information. | ||
|
||
|
||
## Profile configuration | ||
|
||
CrateDB targets should be set up using a configuration like this minimal sample | ||
of settings in your [`profiles.yml`] file. | ||
|
||
<File name='~/.dbt/profiles.yml'> | ||
|
||
```yaml | ||
cratedb_analytics: | ||
target: dev | ||
outputs: | ||
dev: | ||
type: cratedb | ||
host: [clustername].aks1.westeurope.azure.cratedb.net | ||
port: 5432 | ||
user: [username] | ||
pass: [password] | ||
dbname: crate # Do not change this value. CrateDB's only catalog is `crate`. | ||
schema: doc # Define the schema name. CrateDB's default schema is `doc`. | ||
``` | ||
</File> | ||
[CrateDB]: https://cratedb.com/database | ||
[PostgreSQL configuration]: https://docs.getdbt.com/reference/resource-configs/postgres-configs | ||
[PostgreSQL profile setup]: https://docs.getdbt.com/docs/core/connect-data-platform/postgres-setup | ||
[`profiles.yml`]: https://docs.getdbt.com/docs/core/connect-data-platform/profiles.yml | ||
[using dbt with CrateDB]: https://cratedb.com/docs/guide/integrate/dbt/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
website/docs/docs/dbt-versions/core-upgrade/07-upgrading-to-v1.8.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.