Skip to content

Commit

Permalink
Document Databricks adapter initialization script (#99)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmalins authored Sep 21, 2024
1 parent 66af2fd commit a66c866
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/docs/databricks/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ poetry add harlequin[databricks]
pipx install harlequin[databricks]
```

## Usage and Configuration
## Connecting to Databricks

To connect to Databricks you are going to need to provide as CLI arguments:

Expand Down Expand Up @@ -128,7 +128,7 @@ much faster indexing & refreshing of the assets in the Data Catalog pane.

## Other CLI options:

For more details on command line options, run:
For more details on other command line options, run:

```bash
harlequin --help
Expand Down
34 changes: 34 additions & 0 deletions src/docs/databricks/initialization.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: Initialization Scripts
menuOrder: 121
---

Each time you start Harlequin, it will execute SQL commands from a Databricks initialization script.
For example:

```sql
USE CATALOG my_catalog;
SET TIME ZONE 'Asia/Tokyo';
DECLARE yesterday DATE DEFAULT CURRENT_DATE - INTERVAL '1' DAY;
```

Multi-line SQL is allowed, but must be terminated by a semicolon.

## Configuring the Script Location

By default, Harlequin will execute the script found at `~/.databricksrc`. However, you can provide
a different path using the `--init-path` option (aliased to `-i` or `-init`):

```bash
harlequin -a databricks --init-path /path/to/my/script.sql
```

## Disabling Initialization

If you would like to open Harlequin without running the script you have at `~/.databricksrc`, you
can either pass a nonexistent path (or `/dev/null`) to the option above, or start Harlequin with
the `--no-init` option:

```bash
harlequin -a databricks --no-init
```

0 comments on commit a66c866

Please sign in to comment.