diff --git a/packages/nc-gui/lib/enums.ts b/packages/nc-gui/lib/enums.ts
index 776aadbcee..607ae6c0c8 100644
--- a/packages/nc-gui/lib/enums.ts
+++ b/packages/nc-gui/lib/enums.ts
@@ -20,6 +20,7 @@ export enum ClientType {
PG = 'pg',
SQLITE = 'sqlite3',
VITESS = 'vitess',
+ SNOWFLAKE = 'snowflake',
}
export enum Language {
diff --git a/packages/nc-gui/pages/index/index/create-external.vue b/packages/nc-gui/pages/index/index/create-external.vue
index 58ae4ea4c1..af522124f0 100644
--- a/packages/nc-gui/pages/index/index/create-external.vue
+++ b/packages/nc-gui/pages/index/index/create-external.vue
@@ -79,6 +79,8 @@ const validators = computed(() => {
? {
'dataSource.connection.connection.filename': [fieldRequiredValidator()],
}
+ : formState.dataSource.client === ClientType.SNOWFLAKE
+ ? {}
: {
'dataSource.connection.host': [fieldRequiredValidator()],
'dataSource.connection.port': [fieldRequiredValidator()],
@@ -385,6 +387,43 @@ onMounted(async () => {
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/packages/nc-gui/utils/projectCreateUtils.ts b/packages/nc-gui/utils/projectCreateUtils.ts
index 112ad19ab7..29d526a212 100644
--- a/packages/nc-gui/utils/projectCreateUtils.ts
+++ b/packages/nc-gui/utils/projectCreateUtils.ts
@@ -4,7 +4,7 @@ interface ProjectCreateForm {
title: string
dataSource: {
client: ClientType
- connection: DefaultConnection | SQLiteConnection
+ connection: DefaultConnection | SQLiteConnection | SnowflakeConnection
searchPath?: string[]
}
inflection: {
@@ -33,6 +33,15 @@ interface SQLiteConnection {
useNullAsDefault?: boolean
}
+export interface SnowflakeConnection {
+ account: string
+ username: string
+ password: string
+ warehouse: string
+ database?: string
+ schema?: string
+}
+
const defaultHost = 'localhost'
const testDataBaseNames = {
@@ -66,12 +75,16 @@ export const clientTypes = [
text: 'SQLite',
value: ClientType.SQLITE,
},
+ {
+ text: 'SnowFlake',
+ value: ClientType.SNOWFLAKE,
+ },
]
const homeDir = ''
type ConnectionClientType =
- | Exclude
+ | Exclude
| 'tidb'
| 'yugabyte'
| 'citusdb'
@@ -79,7 +92,9 @@ type ConnectionClientType =
| 'oracledb'
| 'greenplum'
-const sampleConnectionData: { [key in ConnectionClientType]: DefaultConnection } & { [ClientType.SQLITE]: SQLiteConnection } = {
+const sampleConnectionData: { [key in ConnectionClientType]: DefaultConnection } & { [ClientType.SQLITE]: SQLiteConnection } & {
+ [ClientType.SNOWFLAKE]: SnowflakeConnection
+} = {
[ClientType.PG]: {
host: defaultHost,
port: '5432',
@@ -116,6 +131,14 @@ const sampleConnectionData: { [key in ConnectionClientType]: DefaultConnection }
},
useNullAsDefault: true,
},
+ [ClientType.SNOWFLAKE]: {
+ account: 'account',
+ username: 'username',
+ password: 'password',
+ warehouse: 'warehouse',
+ database: 'database',
+ schema: 'schema',
+ },
tidb: {
host: defaultHost,
port: '4000',