Merge branch 'feature/datasource-connections' of github.com:Budibase/budibase into feature/datasource-conns
This commit is contained in:
commit
571987a2ce
|
@ -18,11 +18,68 @@ import {
|
||||||
Row,
|
Row,
|
||||||
CreateDatasourceResponse,
|
CreateDatasourceResponse,
|
||||||
UpdateDatasourceResponse,
|
UpdateDatasourceResponse,
|
||||||
UpdateDatasourceRequest,
|
|
||||||
CreateDatasourceRequest,
|
CreateDatasourceRequest,
|
||||||
|
VerifyDatasourceRequest,
|
||||||
|
VerifyDatasourceResponse,
|
||||||
|
IntegrationBase,
|
||||||
|
DatasourcePlus,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
import sdk from "../../sdk"
|
import sdk from "../../sdk"
|
||||||
|
|
||||||
|
function getErrorTables(errors: any, errorType: string) {
|
||||||
|
return Object.entries(errors)
|
||||||
|
.filter(entry => entry[1] === errorType)
|
||||||
|
.map(([name]) => name)
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateError(error: any, newError: any, tables: string[]) {
|
||||||
|
if (!error) {
|
||||||
|
error = ""
|
||||||
|
}
|
||||||
|
if (error.length > 0) {
|
||||||
|
error += "\n"
|
||||||
|
}
|
||||||
|
error += `${newError} ${tables.join(", ")}`
|
||||||
|
return error
|
||||||
|
}
|
||||||
|
|
||||||
|
async function getConnector(
|
||||||
|
datasource: Datasource
|
||||||
|
): Promise<IntegrationBase | DatasourcePlus> {
|
||||||
|
const Connector = await getIntegration(datasource.source)
|
||||||
|
datasource = await sdk.datasources.enrich(datasource)
|
||||||
|
// Connect to the DB and build the schema
|
||||||
|
return new Connector(datasource.config)
|
||||||
|
}
|
||||||
|
|
||||||
|
async function buildSchemaHelper(datasource: Datasource) {
|
||||||
|
const connector = (await getConnector(datasource)) as DatasourcePlus
|
||||||
|
await connector.buildSchema(datasource._id!, datasource.entities!)
|
||||||
|
|
||||||
|
const errors = connector.schemaErrors
|
||||||
|
let error = null
|
||||||
|
if (errors && Object.keys(errors).length > 0) {
|
||||||
|
const noKey = getErrorTables(errors, BuildSchemaErrors.NO_KEY)
|
||||||
|
const invalidCol = getErrorTables(errors, BuildSchemaErrors.INVALID_COLUMN)
|
||||||
|
if (noKey.length) {
|
||||||
|
error = updateError(
|
||||||
|
error,
|
||||||
|
"No primary key constraint found for the following:",
|
||||||
|
noKey
|
||||||
|
)
|
||||||
|
}
|
||||||
|
if (invalidCol.length) {
|
||||||
|
const invalidCols = Object.values(InvalidColumns).join(", ")
|
||||||
|
error = updateError(
|
||||||
|
error,
|
||||||
|
`Cannot use columns ${invalidCols} found in following:`,
|
||||||
|
invalidCol
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return { tables: connector.tables, error }
|
||||||
|
}
|
||||||
|
|
||||||
export async function fetch(ctx: UserCtx) {
|
export async function fetch(ctx: UserCtx) {
|
||||||
// Get internal tables
|
// Get internal tables
|
||||||
const db = context.getAppDB()
|
const db = context.getAppDB()
|
||||||
|
@ -66,6 +123,20 @@ export async function fetch(ctx: UserCtx) {
|
||||||
ctx.body = [bbInternalDb, ...datasources]
|
ctx.body = [bbInternalDb, ...datasources]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function verify(
|
||||||
|
ctx: UserCtx<VerifyDatasourceRequest, VerifyDatasourceResponse>
|
||||||
|
) {
|
||||||
|
const datasource = ctx.request.body.datasource
|
||||||
|
const connector = (await getConnector(datasource)) as IntegrationBase
|
||||||
|
if (!connector.connection) {
|
||||||
|
ctx.throw(400, "Connection information verification not supported")
|
||||||
|
}
|
||||||
|
const connectionInfo = await connector.connection()
|
||||||
|
ctx.body = {
|
||||||
|
connected: connectionInfo.connected,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export async function buildSchemaFromDb(ctx: UserCtx) {
|
export async function buildSchemaFromDb(ctx: UserCtx) {
|
||||||
const db = context.getAppDB()
|
const db = context.getAppDB()
|
||||||
const datasource = await sdk.datasources.get(ctx.params.datasourceId)
|
const datasource = await sdk.datasources.get(ctx.params.datasourceId)
|
||||||
|
@ -311,51 +382,3 @@ export async function query(ctx: UserCtx) {
|
||||||
ctx.throw(400, err)
|
ctx.throw(400, err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getErrorTables(errors: any, errorType: string) {
|
|
||||||
return Object.entries(errors)
|
|
||||||
.filter(entry => entry[1] === errorType)
|
|
||||||
.map(([name]) => name)
|
|
||||||
}
|
|
||||||
|
|
||||||
function updateError(error: any, newError: any, tables: string[]) {
|
|
||||||
if (!error) {
|
|
||||||
error = ""
|
|
||||||
}
|
|
||||||
if (error.length > 0) {
|
|
||||||
error += "\n"
|
|
||||||
}
|
|
||||||
error += `${newError} ${tables.join(", ")}`
|
|
||||||
return error
|
|
||||||
}
|
|
||||||
|
|
||||||
async function buildSchemaHelper(datasource: Datasource) {
|
|
||||||
const Connector = await getIntegration(datasource.source)
|
|
||||||
datasource = await sdk.datasources.enrich(datasource)
|
|
||||||
// Connect to the DB and build the schema
|
|
||||||
const connector = new Connector(datasource.config)
|
|
||||||
await connector.buildSchema(datasource._id, datasource.entities)
|
|
||||||
|
|
||||||
const errors = connector.schemaErrors
|
|
||||||
let error = null
|
|
||||||
if (errors && Object.keys(errors).length > 0) {
|
|
||||||
const noKey = getErrorTables(errors, BuildSchemaErrors.NO_KEY)
|
|
||||||
const invalidCol = getErrorTables(errors, BuildSchemaErrors.INVALID_COLUMN)
|
|
||||||
if (noKey.length) {
|
|
||||||
error = updateError(
|
|
||||||
error,
|
|
||||||
"No primary key constraint found for the following:",
|
|
||||||
noKey
|
|
||||||
)
|
|
||||||
}
|
|
||||||
if (invalidCol.length) {
|
|
||||||
const invalidCols = Object.values(InvalidColumns).join(", ")
|
|
||||||
error = updateError(
|
|
||||||
error,
|
|
||||||
`Cannot use columns ${invalidCols} found in following:`,
|
|
||||||
invalidCol
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return { tables: connector.tables, error }
|
|
||||||
}
|
|
||||||
|
|
|
@ -15,6 +15,11 @@ router
|
||||||
authorized(permissions.BUILDER),
|
authorized(permissions.BUILDER),
|
||||||
datasourceController.fetch
|
datasourceController.fetch
|
||||||
)
|
)
|
||||||
|
.post(
|
||||||
|
"/api/datasources/verify",
|
||||||
|
authorized(permissions.BUILDER),
|
||||||
|
datasourceController.verify
|
||||||
|
)
|
||||||
.get(
|
.get(
|
||||||
"/api/datasources/:datasourceId",
|
"/api/datasources/:datasourceId",
|
||||||
authorized(
|
authorized(
|
||||||
|
|
|
@ -1,8 +1,9 @@
|
||||||
import {
|
import {
|
||||||
Integration,
|
DatasourceFeature,
|
||||||
DatasourceFieldType,
|
DatasourceFieldType,
|
||||||
QueryType,
|
Integration,
|
||||||
IntegrationBase,
|
IntegrationBase,
|
||||||
|
QueryType,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
|
|
||||||
const Airtable = require("airtable")
|
const Airtable = require("airtable")
|
||||||
|
@ -18,6 +19,7 @@ const SCHEMA: Integration = {
|
||||||
"Airtable is a spreadsheet-database hybrid, with the features of a database but applied to a spreadsheet.",
|
"Airtable is a spreadsheet-database hybrid, with the features of a database but applied to a spreadsheet.",
|
||||||
friendlyName: "Airtable",
|
friendlyName: "Airtable",
|
||||||
type: "Spreadsheet",
|
type: "Spreadsheet",
|
||||||
|
features: [DatasourceFeature.CONNECTION_CHECKING],
|
||||||
datasource: {
|
datasource: {
|
||||||
apiKey: {
|
apiKey: {
|
||||||
type: DatasourceFieldType.PASSWORD,
|
type: DatasourceFieldType.PASSWORD,
|
||||||
|
|
|
@ -3,6 +3,7 @@ import {
|
||||||
DatasourceFieldType,
|
DatasourceFieldType,
|
||||||
QueryType,
|
QueryType,
|
||||||
IntegrationBase,
|
IntegrationBase,
|
||||||
|
DatasourceFeature,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
|
|
||||||
const { Database, aql } = require("arangojs")
|
const { Database, aql } = require("arangojs")
|
||||||
|
@ -21,6 +22,7 @@ const SCHEMA: Integration = {
|
||||||
type: "Non-relational",
|
type: "Non-relational",
|
||||||
description:
|
description:
|
||||||
"ArangoDB is a scalable open-source multi-model database natively supporting graph, document and search. All supported data models & access patterns can be combined in queries allowing for maximal flexibility. ",
|
"ArangoDB is a scalable open-source multi-model database natively supporting graph, document and search. All supported data models & access patterns can be combined in queries allowing for maximal flexibility. ",
|
||||||
|
features: [DatasourceFeature.CONNECTION_CHECKING],
|
||||||
datasource: {
|
datasource: {
|
||||||
url: {
|
url: {
|
||||||
type: DatasourceFieldType.STRING,
|
type: DatasourceFieldType.STRING,
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import {
|
import {
|
||||||
|
DatasourceFeature,
|
||||||
DatasourceFieldType,
|
DatasourceFieldType,
|
||||||
Document,
|
Document,
|
||||||
Integration,
|
Integration,
|
||||||
|
@ -18,6 +19,7 @@ const SCHEMA: Integration = {
|
||||||
type: "Non-relational",
|
type: "Non-relational",
|
||||||
description:
|
description:
|
||||||
"Apache CouchDB is an open-source document-oriented NoSQL database, implemented in Erlang.",
|
"Apache CouchDB is an open-source document-oriented NoSQL database, implemented in Erlang.",
|
||||||
|
features: [DatasourceFeature.CONNECTION_CHECKING],
|
||||||
datasource: {
|
datasource: {
|
||||||
url: {
|
url: {
|
||||||
type: DatasourceFieldType.STRING,
|
type: DatasourceFieldType.STRING,
|
||||||
|
|
|
@ -3,6 +3,7 @@ import {
|
||||||
DatasourceFieldType,
|
DatasourceFieldType,
|
||||||
QueryType,
|
QueryType,
|
||||||
IntegrationBase,
|
IntegrationBase,
|
||||||
|
DatasourceFeature,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
|
|
||||||
import AWS from "aws-sdk"
|
import AWS from "aws-sdk"
|
||||||
|
@ -22,6 +23,7 @@ const SCHEMA: Integration = {
|
||||||
"Amazon DynamoDB is a key-value and document database that delivers single-digit millisecond performance at any scale.",
|
"Amazon DynamoDB is a key-value and document database that delivers single-digit millisecond performance at any scale.",
|
||||||
friendlyName: "DynamoDB",
|
friendlyName: "DynamoDB",
|
||||||
type: "Non-relational",
|
type: "Non-relational",
|
||||||
|
features: [DatasourceFeature.CONNECTION_CHECKING],
|
||||||
datasource: {
|
datasource: {
|
||||||
region: {
|
region: {
|
||||||
type: DatasourceFieldType.STRING,
|
type: DatasourceFieldType.STRING,
|
||||||
|
|
|
@ -3,6 +3,7 @@ import {
|
||||||
DatasourceFieldType,
|
DatasourceFieldType,
|
||||||
QueryType,
|
QueryType,
|
||||||
IntegrationBase,
|
IntegrationBase,
|
||||||
|
DatasourceFeature,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
|
|
||||||
import { Client, ClientOptions } from "@elastic/elasticsearch"
|
import { Client, ClientOptions } from "@elastic/elasticsearch"
|
||||||
|
@ -20,6 +21,7 @@ const SCHEMA: Integration = {
|
||||||
"Elasticsearch is a search engine based on the Lucene library. It provides a distributed, multitenant-capable full-text search engine with an HTTP web interface and schema-free JSON documents.",
|
"Elasticsearch is a search engine based on the Lucene library. It provides a distributed, multitenant-capable full-text search engine with an HTTP web interface and schema-free JSON documents.",
|
||||||
friendlyName: "ElasticSearch",
|
friendlyName: "ElasticSearch",
|
||||||
type: "Non-relational",
|
type: "Non-relational",
|
||||||
|
features: [DatasourceFeature.CONNECTION_CHECKING],
|
||||||
datasource: {
|
datasource: {
|
||||||
url: {
|
url: {
|
||||||
type: DatasourceFieldType.STRING,
|
type: DatasourceFieldType.STRING,
|
||||||
|
|
|
@ -3,6 +3,7 @@ import {
|
||||||
Integration,
|
Integration,
|
||||||
QueryType,
|
QueryType,
|
||||||
IntegrationBase,
|
IntegrationBase,
|
||||||
|
DatasourceFeature,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
import { Firestore, WhereFilterOp } from "@google-cloud/firestore"
|
import { Firestore, WhereFilterOp } from "@google-cloud/firestore"
|
||||||
|
|
||||||
|
@ -18,6 +19,7 @@ const SCHEMA: Integration = {
|
||||||
type: "Non-relational",
|
type: "Non-relational",
|
||||||
description:
|
description:
|
||||||
"Cloud Firestore is a flexible, scalable database for mobile, web, and server development from Firebase and Google Cloud.",
|
"Cloud Firestore is a flexible, scalable database for mobile, web, and server development from Firebase and Google Cloud.",
|
||||||
|
features: [DatasourceFeature.CONNECTION_CHECKING],
|
||||||
datasource: {
|
datasource: {
|
||||||
email: {
|
email: {
|
||||||
type: DatasourceFieldType.STRING,
|
type: DatasourceFieldType.STRING,
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
import {
|
import {
|
||||||
|
DatasourceFeature,
|
||||||
DatasourceFieldType,
|
DatasourceFieldType,
|
||||||
DatasourcePlus,
|
DatasourcePlus,
|
||||||
FieldType,
|
FieldType,
|
||||||
|
@ -64,6 +65,7 @@ const SCHEMA: Integration = {
|
||||||
"Create and collaborate on online spreadsheets in real-time and from any device. ",
|
"Create and collaborate on online spreadsheets in real-time and from any device. ",
|
||||||
friendlyName: "Google Sheets",
|
friendlyName: "Google Sheets",
|
||||||
type: "Spreadsheet",
|
type: "Spreadsheet",
|
||||||
|
features: [DatasourceFeature.CONNECTION_CHECKING],
|
||||||
datasource: {
|
datasource: {
|
||||||
spreadsheetId: {
|
spreadsheetId: {
|
||||||
display: "Google Sheet URL",
|
display: "Google Sheet URL",
|
||||||
|
|
|
@ -8,6 +8,7 @@ import {
|
||||||
QueryType,
|
QueryType,
|
||||||
SqlQuery,
|
SqlQuery,
|
||||||
DatasourcePlus,
|
DatasourcePlus,
|
||||||
|
DatasourceFeature,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
import {
|
import {
|
||||||
getSqlQuery,
|
getSqlQuery,
|
||||||
|
@ -39,6 +40,7 @@ const SCHEMA: Integration = {
|
||||||
"Microsoft SQL Server is a relational database management system developed by Microsoft. ",
|
"Microsoft SQL Server is a relational database management system developed by Microsoft. ",
|
||||||
friendlyName: "MS SQL Server",
|
friendlyName: "MS SQL Server",
|
||||||
type: "Relational",
|
type: "Relational",
|
||||||
|
features: [DatasourceFeature.CONNECTION_CHECKING],
|
||||||
datasource: {
|
datasource: {
|
||||||
user: {
|
user: {
|
||||||
type: DatasourceFieldType.STRING,
|
type: DatasourceFieldType.STRING,
|
||||||
|
|
|
@ -3,6 +3,7 @@ import {
|
||||||
DatasourceFieldType,
|
DatasourceFieldType,
|
||||||
QueryType,
|
QueryType,
|
||||||
IntegrationBase,
|
IntegrationBase,
|
||||||
|
DatasourceFeature,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
import {
|
import {
|
||||||
MongoClient,
|
MongoClient,
|
||||||
|
@ -38,6 +39,7 @@ const getSchema = () => {
|
||||||
type: "Non-relational",
|
type: "Non-relational",
|
||||||
description:
|
description:
|
||||||
"MongoDB is a general purpose, document-based, distributed database built for modern application developers and for the cloud era.",
|
"MongoDB is a general purpose, document-based, distributed database built for modern application developers and for the cloud era.",
|
||||||
|
features: [DatasourceFeature.CONNECTION_CHECKING],
|
||||||
datasource: {
|
datasource: {
|
||||||
connectionString: {
|
connectionString: {
|
||||||
type: DatasourceFieldType.STRING,
|
type: DatasourceFieldType.STRING,
|
||||||
|
|
|
@ -7,6 +7,7 @@ import {
|
||||||
Table,
|
Table,
|
||||||
TableSchema,
|
TableSchema,
|
||||||
DatasourcePlus,
|
DatasourcePlus,
|
||||||
|
DatasourceFeature,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
import {
|
import {
|
||||||
getSqlQuery,
|
getSqlQuery,
|
||||||
|
@ -41,6 +42,7 @@ const SCHEMA: Integration = {
|
||||||
type: "Relational",
|
type: "Relational",
|
||||||
description:
|
description:
|
||||||
"MySQL Database Service is a fully managed database service to deploy cloud-native applications. ",
|
"MySQL Database Service is a fully managed database service to deploy cloud-native applications. ",
|
||||||
|
features: [DatasourceFeature.CONNECTION_CHECKING],
|
||||||
datasource: {
|
datasource: {
|
||||||
host: {
|
host: {
|
||||||
type: DatasourceFieldType.STRING,
|
type: DatasourceFieldType.STRING,
|
||||||
|
|
|
@ -7,6 +7,7 @@ import {
|
||||||
SqlQuery,
|
SqlQuery,
|
||||||
Table,
|
Table,
|
||||||
DatasourcePlus,
|
DatasourcePlus,
|
||||||
|
DatasourceFeature,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
import {
|
import {
|
||||||
buildExternalTableId,
|
buildExternalTableId,
|
||||||
|
@ -53,6 +54,7 @@ const SCHEMA: Integration = {
|
||||||
type: "Relational",
|
type: "Relational",
|
||||||
description:
|
description:
|
||||||
"Oracle Database is an object-relational database management system developed by Oracle Corporation",
|
"Oracle Database is an object-relational database management system developed by Oracle Corporation",
|
||||||
|
features: [DatasourceFeature.CONNECTION_CHECKING],
|
||||||
datasource: {
|
datasource: {
|
||||||
host: {
|
host: {
|
||||||
type: DatasourceFieldType.STRING,
|
type: DatasourceFieldType.STRING,
|
||||||
|
|
|
@ -6,6 +6,7 @@ import {
|
||||||
SqlQuery,
|
SqlQuery,
|
||||||
Table,
|
Table,
|
||||||
DatasourcePlus,
|
DatasourcePlus,
|
||||||
|
DatasourceFeature,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
import {
|
import {
|
||||||
getSqlQuery,
|
getSqlQuery,
|
||||||
|
@ -50,6 +51,7 @@ const SCHEMA: Integration = {
|
||||||
type: "Relational",
|
type: "Relational",
|
||||||
description:
|
description:
|
||||||
"PostgreSQL, also known as Postgres, is a free and open-source relational database management system emphasizing extensibility and SQL compliance.",
|
"PostgreSQL, also known as Postgres, is a free and open-source relational database management system emphasizing extensibility and SQL compliance.",
|
||||||
|
features: [DatasourceFeature.CONNECTION_CHECKING],
|
||||||
datasource: {
|
datasource: {
|
||||||
host: {
|
host: {
|
||||||
type: DatasourceFieldType.STRING,
|
type: DatasourceFieldType.STRING,
|
||||||
|
|
|
@ -1,4 +1,9 @@
|
||||||
import { DatasourceFieldType, Integration, QueryType } from "@budibase/types"
|
import {
|
||||||
|
DatasourceFeature,
|
||||||
|
DatasourceFieldType,
|
||||||
|
Integration,
|
||||||
|
QueryType,
|
||||||
|
} from "@budibase/types"
|
||||||
import Redis from "ioredis"
|
import Redis from "ioredis"
|
||||||
|
|
||||||
interface RedisConfig {
|
interface RedisConfig {
|
||||||
|
@ -11,9 +16,11 @@ interface RedisConfig {
|
||||||
|
|
||||||
const SCHEMA: Integration = {
|
const SCHEMA: Integration = {
|
||||||
docs: "https://redis.io/docs/",
|
docs: "https://redis.io/docs/",
|
||||||
description: "",
|
description:
|
||||||
|
"Redis is a caching tool, providing powerful key-value store capabilities.",
|
||||||
friendlyName: "Redis",
|
friendlyName: "Redis",
|
||||||
type: "Non-relational",
|
type: "Non-relational",
|
||||||
|
features: [DatasourceFeature.CONNECTION_CHECKING],
|
||||||
datasource: {
|
datasource: {
|
||||||
host: {
|
host: {
|
||||||
type: "string",
|
type: "string",
|
||||||
|
|
|
@ -3,6 +3,7 @@ import {
|
||||||
QueryType,
|
QueryType,
|
||||||
IntegrationBase,
|
IntegrationBase,
|
||||||
DatasourceFieldType,
|
DatasourceFieldType,
|
||||||
|
DatasourceFeature,
|
||||||
} from "@budibase/types"
|
} from "@budibase/types"
|
||||||
|
|
||||||
const AWS = require("aws-sdk")
|
const AWS = require("aws-sdk")
|
||||||
|
@ -22,6 +23,7 @@ const SCHEMA: Integration = {
|
||||||
"Amazon Simple Storage Service (Amazon S3) is an object storage service that offers industry-leading scalability, data availability, security, and performance.",
|
"Amazon Simple Storage Service (Amazon S3) is an object storage service that offers industry-leading scalability, data availability, security, and performance.",
|
||||||
friendlyName: "Amazon S3",
|
friendlyName: "Amazon S3",
|
||||||
type: "Object store",
|
type: "Object store",
|
||||||
|
features: [DatasourceFeature.CONNECTION_CHECKING],
|
||||||
datasource: {
|
datasource: {
|
||||||
region: {
|
region: {
|
||||||
type: "string",
|
type: "string",
|
||||||
|
|
|
@ -1,4 +1,9 @@
|
||||||
import { Integration, QueryType, SqlQuery } from "@budibase/types"
|
import {
|
||||||
|
DatasourceFeature,
|
||||||
|
Integration,
|
||||||
|
QueryType,
|
||||||
|
SqlQuery,
|
||||||
|
} from "@budibase/types"
|
||||||
import { Snowflake } from "snowflake-promise"
|
import { Snowflake } from "snowflake-promise"
|
||||||
|
|
||||||
interface SnowflakeConfig {
|
interface SnowflakeConfig {
|
||||||
|
@ -16,6 +21,7 @@ const SCHEMA: Integration = {
|
||||||
"Snowflake is a solution for data warehousing, data lakes, data engineering, data science, data application development, and securely sharing and consuming shared data.",
|
"Snowflake is a solution for data warehousing, data lakes, data engineering, data science, data application development, and securely sharing and consuming shared data.",
|
||||||
friendlyName: "Snowflake",
|
friendlyName: "Snowflake",
|
||||||
type: "Relational",
|
type: "Relational",
|
||||||
|
features: [DatasourceFeature.CONNECTION_CHECKING],
|
||||||
datasource: {
|
datasource: {
|
||||||
account: {
|
account: {
|
||||||
type: "string",
|
type: "string",
|
||||||
|
|
|
@ -14,6 +14,14 @@ export interface CreateDatasourceRequest {
|
||||||
fetchSchema?: boolean
|
fetchSchema?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface VerifyDatasourceRequest {
|
||||||
|
datasource: Datasource
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface VerifyDatasourceResponse {
|
||||||
|
connected: boolean
|
||||||
|
}
|
||||||
|
|
||||||
export interface UpdateDatasourceRequest extends Datasource {
|
export interface UpdateDatasourceRequest extends Datasource {
|
||||||
datasource: Datasource
|
datasource: Datasource
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,6 +73,10 @@ export enum FilterType {
|
||||||
ONE_OF = "oneOf",
|
ONE_OF = "oneOf",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export enum DatasourceFeature {
|
||||||
|
CONNECTION_CHECKING = "connection",
|
||||||
|
}
|
||||||
|
|
||||||
export interface StepDefinition {
|
export interface StepDefinition {
|
||||||
key: string
|
key: string
|
||||||
template: string
|
template: string
|
||||||
|
@ -111,6 +115,7 @@ export interface Integration {
|
||||||
docs: string
|
docs: string
|
||||||
plus?: boolean
|
plus?: boolean
|
||||||
auth?: { type: string }
|
auth?: { type: string }
|
||||||
|
features?: DatasourceFeature[]
|
||||||
relationships?: boolean
|
relationships?: boolean
|
||||||
description: string
|
description: string
|
||||||
friendlyName: string
|
friendlyName: string
|
||||||
|
|
Loading…
Reference in New Issue