Skip to content

Add snippets for datasource and Jaeger properties configuration#92

Merged
angelozerr merged 2 commits intoredhat-developer:masterfrom
fbricon:ds-snippet
Sep 25, 2019
Merged

Add snippets for datasource and Jaeger properties configuration#92
angelozerr merged 2 commits intoredhat-developer:masterfrom
fbricon:ds-snippet

Conversation

@fbricon
Copy link
Copy Markdown
Collaborator

@fbricon fbricon commented Sep 25, 2019

Fixes #90 (Datasource snippet)
Fixes #93 (Jaeger snippet)

@fbricon
Copy link
Copy Markdown
Collaborator Author

fbricon commented Sep 25, 2019

@lordofthejars since configuring datasource properties is not Panache-specific, I changed the description to a more generic "Configure Quarkus datasource"
Screen Shot 2019-09-25 at 10 47 06 AM

@fbricon fbricon force-pushed the ds-snippet branch 2 times, most recently from 37f4adc to b9e013a Compare September 25, 2019 08:53
Comment thread snippets/properties.json Outdated
"prefix": "qds",
"body": [
"quarkus.datasource.url=${1:jdbc:mariadb://localhost:3306/mydb}",
"quarkus.datasource.driver=${2:org.mariadb.jdbc.Driver}",
Copy link
Copy Markdown
Contributor

@angelozerr angelozerr Sep 25, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not using choice https://code.visualstudio.com/docs/editor/userdefinedsnippets#_choice to provide a list of JDBC driver?

Comment thread snippets/properties.json Outdated
"Add datasource properties": {
"prefix": "qds",
"body": [
"quarkus.datasource.url=${1:jdbc:mariadb://localhost:3306/mydb}",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not using choice https://code.visualstudio.com/docs/editor/userdefinedsnippets#_choice to provide a list of syntax URL (according JDBC driver)?

Comment thread snippets/properties.json Outdated
"quarkus.datasource.driver=${2:org.mariadb.jdbc.Driver}",
"quarkus.datasource.username=${3:developer}",
"quarkus.datasource.password=${4:developer}",
"quarkus.hibernate-orm.database.generation=${5:update}"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use choice to provide the list none, create, drop-and-create, drop, update

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

excellent idea, this works well

Signed-off-by: Fred Bricon <fbricon@gmail.com>
@fbricon
Copy link
Copy Markdown
Collaborator Author

fbricon commented Sep 25, 2019

now with choices
ds-snippet

@fbricon fbricon changed the title Add snippet for datasource properties configuration Add snippets for datasource and Jaeger properties configuration Sep 25, 2019
@fbricon
Copy link
Copy Markdown
Collaborator Author

fbricon commented Sep 25, 2019

included commit for Jaeger snippet

Signed-off-by: Fred Bricon <fbricon@gmail.com>
Comment thread snippets/properties.json
"prefix": "qds",
"body": [
"quarkus.datasource.url=${1|jdbc:mariadb://localhost:3306/mydb,jdbc:mysql://localhost:3306/test,jdbc:h2:mem:mydb,jdbc:postgresql://localhost/mydb,jdbc:sqlserver://localhost:1433;databaseName=mydb|}",
"quarkus.datasource.driver=${2|org.mariadb.jdbc.Driver,org.mysql.jdbc.Driver,org.h2.Driver,org.postgresql.Driver,com.microsoft.sqlserver.jdbc.SQLServerDriver|}",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's great it works! What about other JDBC driver like derby? Perhaps we will add another JDB driver according user feedback?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think Derby is not supported yet in Quarkus.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @lordofthejars for your feedback! We will add another database according user feedback.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I listed the drivers according to the quarkus extensions found in https://quarkus.io/guides/datasource-guide#jdbc-url-configurations

@angelozerr angelozerr merged commit f7f4d9f into redhat-developer:master Sep 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add snippet for Jaeger properties configuration Add snippet for configuring Panache

3 participants