Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/Refactor the "Add data" forms #5162

Merged
merged 14 commits into from
Jul 24, 2024
Merged
28 changes: 18 additions & 10 deletions runtime/drivers/athena/athena.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,18 @@ var spec = drivers.Spec{
DisplayName: "Amazon Athena",
Description: "Connect to Amazon Athena database.",
DocsURL: "",
ConfigProperties: []*drivers.PropertySpec{
{
Key: "aws_access_key_id",
Type: drivers.StringPropertyType,
Secret: true,
},
{
Key: "aws_secret_access_key",
Type: drivers.StringPropertyType,
Secret: true,
},
},
SourceProperties: []*drivers.PropertySpec{
{
Key: "sql",
Expand Down Expand Up @@ -52,17 +64,13 @@ var spec = drivers.Spec{
Placeholder: "us-east-1",
Required: false,
},
},
ConfigProperties: []*drivers.PropertySpec{
{
Key: "aws_access_key_id",
Type: drivers.StringPropertyType,
Secret: true,
},
{
Key: "aws_secret_access_key",
Type: drivers.StringPropertyType,
Secret: true,
Key: "name",
Type: drivers.StringPropertyType,
DisplayName: "Source name",
Description: "The name of the source",
Placeholder: "my_new_source",
Required: true,
},
},
}
Expand Down
8 changes: 8 additions & 0 deletions runtime/drivers/azure/azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@ var spec = drivers.Spec{
Description: "Azure storage account name.",
Required: false,
},
{
Key: "name",
Type: drivers.StringPropertyType,
DisplayName: "Source name",
Description: "The name of the source",
Placeholder: "my_new_source",
Required: true,
},
},
ImplementsObjectStore: true,
}
Expand Down
8 changes: 8 additions & 0 deletions runtime/drivers/bigquery/bigquery.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,14 @@ var spec = drivers.Spec{
Placeholder: "my-project",
Hint: "Rill will use the project ID from your local credentials, unless set here. Set this if no project ID configured in credentials.",
},
{
Key: "name",
Type: drivers.StringPropertyType,
DisplayName: "Source name",
Description: "The name of the source",
Placeholder: "my_new_source",
Required: true,
},
{
Key: "google_application_credentials",
Type: drivers.InformationalPropertyType,
Expand Down
36 changes: 0 additions & 36 deletions runtime/drivers/clickhouse/clickhouse.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,42 +34,6 @@ var spec = drivers.Spec{
Placeholder: "clickhouse://localhost:9000?username=default&password=",
NoPrompt: true,
},
{
Key: "host",
Type: drivers.StringPropertyType,
DisplayName: "host",
Required: false,
Placeholder: "localhost",
},
{
Key: "port",
Type: drivers.NumberPropertyType,
DisplayName: "port",
Required: false,
Placeholder: "9000",
},
{
Key: "username",
Type: drivers.StringPropertyType,
DisplayName: "username",
Required: false,
Placeholder: "default",
},
{
Key: "password",
Type: drivers.StringPropertyType,
DisplayName: "password",
Required: false,
Secret: true,
},
{
Key: "ssl",
Type: drivers.BooleanPropertyType,
DisplayName: "ssl",
Required: false,
},
},
SourceProperties: []*drivers.PropertySpec{
{
Key: "host",
Type: drivers.StringPropertyType,
Expand Down
34 changes: 0 additions & 34 deletions runtime/drivers/druid/druid.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,40 +36,6 @@ var spec = drivers.Spec{
Secret: true,
NoPrompt: true,
},
{
Key: "host",
Type: drivers.StringPropertyType,
DisplayName: "host",
Required: false,
},
{
Key: "port",
Type: drivers.NumberPropertyType,
DisplayName: "port",
Required: false,
Placeholder: "8888",
},
{
Key: "username",
Type: drivers.StringPropertyType,
DisplayName: "username",
Required: false,
},
{
Key: "password",
Type: drivers.StringPropertyType,
DisplayName: "password",
Required: false,
Secret: true,
},
{
Key: "ssl",
Type: drivers.BooleanPropertyType,
DisplayName: "ssl",
Required: false,
},
},
SourceProperties: []*drivers.PropertySpec{
{
Key: "host",
Type: drivers.StringPropertyType,
Expand Down
28 changes: 24 additions & 4 deletions runtime/drivers/duckdb/duckdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,12 @@ var spec = drivers.Spec{
DocsURL: "https://docs.rilldata.com/reference/connectors/motherduck",
ConfigProperties: []*drivers.PropertySpec{
{
Key: "path",
Type: drivers.StringPropertyType,
Key: "path",
Type: drivers.StringPropertyType,
Required: true,
DisplayName: "Path",
Description: "Path to external DuckDB database.",
Placeholder: "/path/to/main.db",
},
},
SourceProperties: []*drivers.PropertySpec{
Expand All @@ -56,8 +60,24 @@ var spec = drivers.Spec{
Type: drivers.StringPropertyType,
Required: true,
DisplayName: "DB",
Description: "Path to external DuckDB database. Use md:<dbname> for motherduckb.",
Placeholder: "/path/to/main.db or md:main.db(for motherduck)",
Description: "Path to DuckDB database",
Placeholder: "/path/to/duckdb.db",
},
{
Key: "sql",
Type: drivers.StringPropertyType,
Required: true,
DisplayName: "SQL",
Description: "Query to extract data from DuckDB.",
Placeholder: "select * from table;",
},
{
Key: "name",
Type: drivers.StringPropertyType,
DisplayName: "Source name",
Description: "The name of the source",
Placeholder: "my_new_source",
Required: true,
},
},
ImplementsCatalog: true,
Expand Down
8 changes: 8 additions & 0 deletions runtime/drivers/gcs/gcs.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,14 @@ var spec = drivers.Spec{
Required: true,
Hint: "Glob patterns are supported",
},
{
Key: "name",
Type: drivers.StringPropertyType,
DisplayName: "Source name",
Description: "The name of the source",
Placeholder: "my_new_source",
Required: true,
},
{
Key: "gcp.credentials",
Type: drivers.InformationalPropertyType,
Expand Down
8 changes: 8 additions & 0 deletions runtime/drivers/https/https.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ var spec = drivers.Spec{
Placeholder: "https://example.com/file.csv",
Required: true,
},
{
Key: "name",
Type: drivers.StringPropertyType,
DisplayName: "Source name",
Description: "The name of the source",
Placeholder: "my_new_source",
Required: true,
},
},
ImplementsFileStore: true,
}
Expand Down
8 changes: 8 additions & 0 deletions runtime/drivers/mysql/mysql.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ var spec = drivers.Spec{
Placeholder: "username:password@tcp(example.com:3306)/my-db",
Hint: "Either set this or pass --var connector.mysql.dsn=... to rill start",
},
{
Key: "name",
Type: drivers.StringPropertyType,
DisplayName: "Source name",
Description: "The name of the source",
Placeholder: "my_new_source",
Required: true,
},
},
ImplementsSQLStore: true,
}
Expand Down
36 changes: 0 additions & 36 deletions runtime/drivers/pinot/pinot.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,42 +32,6 @@ var spec = drivers.Spec{
Secret: true,
NoPrompt: true,
},
{
Key: "host",
Type: drivers.StringPropertyType,
DisplayName: "host",
Required: false,
},
{
Key: "port",
Type: drivers.NumberPropertyType,
DisplayName: "port",
Required: false,
Placeholder: "9000",
},
{
Key: "username",
Type: drivers.StringPropertyType,
DisplayName: "username",
Required: false,
Placeholder: "username",
},
{
Key: "password",
Type: drivers.StringPropertyType,
DisplayName: "password",
Required: false,
Secret: true,
},
{
Key: "ssl",
Type: drivers.BooleanPropertyType,
DisplayName: "ssl",
Required: false,
Default: "true",
},
},
SourceProperties: []*drivers.PropertySpec{
{
Key: "host",
Type: drivers.StringPropertyType,
Expand Down
8 changes: 8 additions & 0 deletions runtime/drivers/postgres/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ var spec = drivers.Spec{
Placeholder: "postgresql://postgres:postgres@localhost:5432/postgres",
Hint: "Either set this or pass --var connector.postgres.database_url=... to rill start",
},
{
Key: "name",
Type: drivers.StringPropertyType,
DisplayName: "Source name",
Description: "The name of the source",
Placeholder: "my_new_source",
Required: true,
},
},
ImplementsSQLStore: true,
}
Expand Down
8 changes: 8 additions & 0 deletions runtime/drivers/redshift/redshift.go
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,14 @@ var spec = drivers.Spec{
Placeholder: "arn:aws:iam::03214372:role/service-role/AmazonRedshift-CommandsAccessRole-20240307T203902",
Required: true,
},
{
Key: "name",
Type: drivers.StringPropertyType,
DisplayName: "Source name",
Description: "The name of the source",
Placeholder: "my_new_source",
Required: true,
},
},
ImplementsSQLStore: true,
}
Expand Down
8 changes: 8 additions & 0 deletions runtime/drivers/s3/s3.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,14 @@ var spec = drivers.Spec{
Required: false,
Hint: "Overrides the S3 endpoint to connect to. This should only be used to connect to S3-compatible services, such as Cloudflare R2 or MinIO.",
},
{
Key: "name",
Type: drivers.StringPropertyType,
DisplayName: "Source name",
Description: "The name of the source",
Placeholder: "my_new_source",
Required: true,
},
{
Key: "aws.credentials",
Type: drivers.InformationalPropertyType,
Expand Down
8 changes: 8 additions & 0 deletions runtime/drivers/salesforce/salesforce.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,14 @@ var spec = drivers.Spec{
Default: defaultClientID,
Hint: "Either set this or pass --var connector.salesforce.client_id=... to rill start",
},
{
Key: "name",
Type: drivers.StringPropertyType,
DisplayName: "Source name",
Description: "The name of the source",
Placeholder: "my_new_source",
Required: true,
},
},
ImplementsSQLStore: true,
}
Expand Down
8 changes: 8 additions & 0 deletions runtime/drivers/snowflake/snowflake.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ var spec = drivers.Spec{
Placeholder: "my_user_name:my_password@ac123456/my_database/my_schema?warehouse=my_warehouse&role=my_user_role",
Hint: "Either set this or pass --var connector.snowflake.dsn=... to rill start",
},
{
Key: "name",
Type: drivers.StringPropertyType,
DisplayName: "Source name",
Description: "The name of the source",
Placeholder: "my_new_source",
Required: true,
},
},
ImplementsSQLStore: true,
}
Expand Down
10 changes: 9 additions & 1 deletion runtime/drivers/sqlite/sqlite.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func (d driver) Spec() drivers.Spec {
Required: true,
DisplayName: "DB",
Description: "Path to SQLite db file",
Placeholder: "sqlite.db",
Placeholder: "/path/to/sqlite.db",
},
{
Key: "table",
Expand All @@ -71,6 +71,14 @@ func (d driver) Spec() drivers.Spec {
Description: "SQLite table name",
Placeholder: "table",
},
{
Key: "name",
Type: drivers.StringPropertyType,
DisplayName: "Source name",
Description: "The name of the source",
Placeholder: "my_new_source",
Required: true,
},
},
ImplementsRegistry: true,
ImplementsCatalog: true,
Expand Down
Loading
Loading