-
Notifications
You must be signed in to change notification settings - Fork 2
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
add driver for snowflake/mysql #66
Conversation
7fd1453
to
5d7fdbe
Compare
@@ -569,10 +569,28 @@ func (r *connectionResource) Schema( | |||
|
|||
// PostgreSQL Fields | |||
"driver": schema.StringAttribute{ | |||
MarkdownDescription: "PostgreSQL: The name of a PostgreSQL driver.", | |||
Optional: true, | |||
MarkdownDescription: strings.Join( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO: It's better to use multiline string syntax.
MarkdownDescription: `
Snowflake, MySQL, PostgreSQL: The name of a Database driver. Possible values are:
- MySQL: null, mysql_connector_java_5_1_49
- Snowflake: null, snowflake_jdbc_3_14_2, snowflake_jdbc_3_17_0
- PostgreSQL: postgresql_42_5_1, postgresql_9_4_1205_jdbc41
`
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// PostgreSQL | ||
"postgresql_42_5_1", | ||
"postgresql_9_4_1205_jdbc41", | ||
), | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ASK: Is it necessary to validate the combination of driver and connection type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thx!
- added 69e4751
3947107
to
a18ee95
Compare
This pull request includes changes to the
connection
resource to support additional database drivers and improve the handling of thedriver
field. The most important changes include updating the documentation, modifying theCreateConnectionInput
andUpdateConnectionInput
structs, and enhancing the schema for thedriver
field.Support for additional database drivers:
docs/resources/connection.md
: Updated thedriver
field description to include support for Snowflake and MySQL drivers, in addition to PostgreSQL. Added possible values for each database type.Handling of the
driver
field:internal/client/connection.go
: Changed the type of theDriver
field in bothCreateConnectionInput
andUpdateConnectionInput
structs from*string
to*parameter.NullableString
. [1] [2]internal/provider/connection_resource.go
: Updated theToCreateConnectionInput
andToUpdateConnectionInput
methods to usemodel.NewNullableString
for theDriver
field. [1] [2]internal/provider/connection_resource.go
: Enhanced the schema for thedriver
field to include descriptions and validators for the new database types and their respective possible values.