Metadata-Version: 2.1
Name: meltanolabs-target-snowflake
Version: 0.3.2
Summary: `target-snowflake` is a Singer target for Snowflake, built with the Meltano SDK for Singer Targets.
License: Apache 2.0
Keywords: ELT,Snowflake
Author: Ken Payne
Requires-Python: >=3.7.1,<3.12
Classifier: License :: Other/Proprietary License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: cryptography (>=40.0.2,<41.0.0)
Requires-Dist: requests (>=2.31.0,<3.0.0)
Requires-Dist: singer-sdk (==0.29.0)
Requires-Dist: snowflake-sqlalchemy (>=1.4.7,<2.0.0)
Description-Content-Type: text/markdown

# `target-snowflake`

Target for Snowflake.

Built with the [Meltano Singer SDK](https://sdk.meltano.com).

## Capabilities

* `about`
* `stream-maps`
* `schema-flattening`
* `target-schema`

## Settings

| Setting              | Required | Default | Description |
|:---------------------|:--------:|:-------:|:------------|
| user                 | True     | None    | The login name for your Snowflake user. |
| password             | True     | None    | The password for your Snowflake user. |
| account              | True     | None    | Your account identifier. See [Account Identifiers](https://docs.snowflake.com/en/user-guide/admin-account-identifier.html). |
| database             | True     | None    | The initial database for the Snowflake session. |
| schema               | False    | None    | The initial schema for the Snowflake session. |
| warehouse            | False    | None    | The initial warehouse for the session. |
| role                 | False    | None    | The initial role for the session. |
| add_record_metadata  | False    |       1 | Whether to add metadata columns. |
| clean_up_batch_files | False    |       1 | Whether to remove batch files after processing. |
| default_target_schema| False    | None    | The default target database schema name to use for all streams. |
| stream_maps          | False    | None    | Config object for stream maps capability. For more information check out [Stream Maps](https://sdk.meltano.com/en/latest/stream_maps.html). |
| stream_map_config    | False    | None    | User-defined config values to be used within map expressions. |
| flattening_enabled   | False    | None    | 'True' to enable schema flattening and automatically expand nested properties. |
| flattening_max_depth | False    | None    | The max depth to flatten schemas. |

A full list of supported settings and capabilities is available by running: `target-snowflake --about`

### Configure using environment variables

This Singer target will automatically import any environment variables within the working directory's
`.env` if the `--config=ENV` is provided, such that config values will be considered if a matching
environment variable is set either in the terminal context or in the `.env` file.

## Usage

You can easily run `target-snowflake` by itself or in a pipeline using [Meltano](https://meltano.com/).

### Executing the Target Directly

```bash
target-snowflake --version
target-snowflake --help
# Test using the "Carbon Intensity" sample:
tap-carbon-intensity | target-snowflake --config /path/to/target-snowflake-config.json
```

## Developer Resources

### Initialize your Development Environment

```bash
pipx install poetry
poetry install
```

### Create and Run Tests

Create tests within the `target_snowflake/tests` subfolder and
  then run:

```bash
poetry run pytest
```

You can also test the `target-snowflake` CLI interface directly using `poetry run`:

```bash
poetry run target-snowflake --help
```

### Testing with [Meltano](https://meltano.com/)

_**Note:** This target will work in any Singer environment and does not require Meltano.
Examples here are for convenience and to streamline end-to-end orchestration scenarios._

Your project comes with a custom `meltano.yml` project file already created.

Next, install Meltano (if you haven't already) and any needed plugins:

```bash
# Install meltano
pipx install meltano
# Initialize meltano within this directory
cd target-snowflake
meltano install
```

Now you can test and orchestrate using Meltano:

```bash
# Test invocation:
meltano invoke target-snowflake --version
# OR run a test `elt` pipeline with the Carbon Intensity sample tap:
meltano run tap-carbon-intensity target-snowflake
```

### SDK Dev Guide

See the [dev guide](https://sdk.meltano.com/en/latest/dev_guide.html) for more instructions on how to use the Meltano SDK to
develop your own Singer taps and targets.

