-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
14 changed files
with
464 additions
and
64 deletions.
There are no files selected for viewing
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 was deleted.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
import { SnowflakeConfig } from '@/grpc_generated/peers'; | ||
import { Setting } from './common'; | ||
|
||
export const snowflakeSetting: Setting[] = [ | ||
{ | ||
label: 'Account ID', | ||
stateHandler: (value, setter) => | ||
setter((curr) => ({ ...curr, accountId: value })), | ||
tips: 'This is the unique identifier for your Snowflake account. It has a URL-like format', | ||
helpfulLink: | ||
'https://docs.snowflake.com/en/user-guide/admin-account-identifier', | ||
}, | ||
{ | ||
label: 'Username', | ||
stateHandler: (value, setter) => | ||
setter((curr) => ({ ...curr, username: value })), | ||
tips: 'This is the username you use to login to your Snowflake account.', | ||
helpfulLink: | ||
'https://docs.snowflake.com/en/user-guide/admin-user-management', | ||
}, | ||
{ | ||
label: 'Private Key', | ||
stateHandler: (value, setter) => | ||
setter((curr) => ({ ...curr, privateKey: value })), | ||
type: 'file', | ||
tips: 'This can be of any file extension. If you are using an encrypted key, you must fill the below password field for decryption.', | ||
helpfulLink: 'https://docs.snowflake.com/en/user-guide/key-pair-auth', | ||
}, | ||
{ | ||
label: 'Warehouse', | ||
stateHandler: (value, setter) => | ||
setter((curr) => ({ ...curr, warehouse: value })), | ||
tips: 'Warehouses denote a cluster of snowflake resources.', | ||
helpfulLink: 'https://docs.snowflake.com/en/user-guide/warehouses', | ||
}, | ||
{ | ||
label: 'Database', | ||
stateHandler: (value, setter) => | ||
setter((curr) => ({ ...curr, database: value })), | ||
tips: 'Specify which database to associate with this peer.', | ||
helpfulLink: 'https://docs.snowflake.com/en/sql-reference/snowflake-db', | ||
}, | ||
{ | ||
label: 'Role', | ||
stateHandler: (value, setter) => | ||
setter((curr) => ({ ...curr, role: value })), | ||
tips: 'You could use a default role, or setup a role with the required permissions.', | ||
helpfulLink: | ||
'https://docs.snowflake.com/en/user-guide/security-access-control-overview#roles', | ||
}, | ||
{ | ||
label: 'Query Timeout', | ||
stateHandler: (value, setter) => | ||
setter((curr) => ({ ...curr, queryTimeout: parseInt(value, 10) || 30 })), | ||
optional: true, | ||
tips: 'This is the maximum time in seconds that a query can run before being cancelled. If not specified, the default is 30 seconds', | ||
default: 30, | ||
}, | ||
{ | ||
label: 'S3 Integration', | ||
stateHandler: (value, setter) => | ||
setter((curr) => ({ ...curr, s3Integration: value })), | ||
optional: true, | ||
tips: `This is needed only if you plan to run a mirror and you wish to stage AVRO files on S3.`, | ||
helpfulLink: | ||
'https://docs.snowflake.com/en/user-guide/data-load-s3-config-storage-integration', | ||
}, | ||
{ | ||
label: 'Password', | ||
stateHandler: (value, setter) => { | ||
if (!value.length) { | ||
// remove password key from state if empty | ||
setter((curr) => { | ||
delete curr['password']; | ||
return curr; | ||
}); | ||
} else setter((curr) => ({ ...curr, password: value })); | ||
}, | ||
type: 'password', | ||
optional: true, | ||
tips: 'This is needed only if the private key you provided is encrypted.', | ||
helpfulLink: 'https://docs.snowflake.com/en/user-guide/key-pair-auth', | ||
}, | ||
]; | ||
|
||
export const blankSnowflakeSetting: SnowflakeConfig = { | ||
accountId: '', | ||
privateKey: '', | ||
username: '', | ||
warehouse: '', | ||
database: '', | ||
role: '', | ||
queryTimeout: 30, | ||
s3Integration: '', | ||
}; |
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.