Skip to content

Commit

Permalink
Bootstrap snowflake connector
Browse files Browse the repository at this point in the history
  • Loading branch information
loicknuchel committed Feb 8, 2024
1 parent 27ad2f2 commit 5df3fe7
Show file tree
Hide file tree
Showing 24 changed files with 7,924 additions and 0 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Get the help simply by running the CLI (`npx azimutt@latest`) or for a specific
- ex: `npx azimutt export "mongodb+srv://user:[email protected]"`
- ex: `npx azimutt export mysql://user:[email protected]:3306/my_db`
- ex: `npx azimutt export postgresql://postgres:postgres@localhost:5432/azimutt_dev`
- ex: `npx azimutt export https://user:[email protected]/my_db`
- ex: `npx azimutt export Server=host.com,1433;Database=db;User Id=user;Password=pass`
- `url` the database connection url, must contain everything needed (user, pass, port...)
- `--database` is optional, restrict schema extraction to this database
Expand Down
1 change: 1 addition & 0 deletions frontend/src/Services/DatabaseSource.elm
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ databases =
, { key = "mysql", sampleUrl = "mysql://<user>:<pass>@<host>:<port>/<db>", issue = Nothing }
, { key = "couchbase", sampleUrl = "couchbases://<user>:<pass>@<host>", issue = Nothing }
, { key = "mongodb", sampleUrl = "mongodb+srv://<user>:<pass>@<host>", issue = Nothing }
, { key = "snowflake", sampleUrl = "https://<user>:<pass>@<account>.snowflakecomputing.com/<database>", issue = Nothing }
, { key = "oracle", sampleUrl = "oracle:thin:<user>/<pass>@<host>:<port>:<db>", issue = Just "https://github.com/azimuttapp/azimutt/issues/217" }
, { key = "sqlite", sampleUrl = "file:<path>", issue = Just "https://github.com/azimuttapp/azimutt/issues/115" }
]
Expand Down
3 changes: 3 additions & 0 deletions libs/connector-snowflake/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
out
*.tgz
4 changes: 4 additions & 0 deletions libs/connector-snowflake/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
tests/
jest.config.js
tsconfig.json
*.tgz
28 changes: 28 additions & 0 deletions libs/connector-snowflake/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Snowflake connector

This library is able to connect to [Snowflake](https://www.snowflake.com), extract its schema and more...

It lists all schemas, tables, columns, relations and types and format them in a JSON Schema.

This library is made by [Azimutt](https://azimutt.app) to allow people to explore their Snowflake database.
It's accessible through the [Desktop app](../../desktop) (soon), the [CLI](https://www.npmjs.com/package/azimutt) or even the website using the [gateway](../../gateway) server.

**Feel free to use it and even submit PR to improve it:**

- improve [Snowflake queries](./src/snowflake.ts) (look at `getSchema` function)

## Publish

- update `package.json` version
- update lib versions (`npm run update` + manual) `npm run update` & run `npm install`
- test with `npm run dry-publish` and check `azimutt-connector-snowflake-x.y.z.tgz` content
- launch `npm publish --access public`

View it on [npm](https://www.npmjs.com/package/@azimutt/connector-snowflake).

## Dev

If you need to develop on multiple libs at the same time (ex: want to update a connector and try it through the CLI), depend on local libs but publish & revert before commit.

- Depend on a local lib: `npm install <path>`, ex: `npm install ../database-types`
- "Publish" lib locally by building it: `npm run build`
6 changes: 6 additions & 0 deletions libs/connector-snowflake/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
transform: {'^.+\\.ts?$': 'ts-jest'},
testEnvironment: 'node',
testRegex: '/tests/.*\\.(test|spec)?\\.(ts|tsx)$',
moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx', 'json', 'node']
}
Loading

0 comments on commit 5df3fe7

Please sign in to comment.