Skip to content

Commit

Permalink
Add snippet for datasource properties configuration
Browse files Browse the repository at this point in the history
Signed-off-by: Fred Bricon <fbricon@gmail.com>
  • Loading branch information
fbricon authored and angelozerr committed Sep 25, 2019
1 parent fcc700e commit 1414645
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Expand Up @@ -35,6 +35,11 @@ This extension provides several code snippets, available when editing Java files
* **qtrc** - Create a new Quarkus test resource class
* **qntrc** - Create a new Quarkus native test resource class

When editing `application.properties` files, you have access to:

* **qds** - Configure a Quarkus datasource


## Requirements

* Java JDK (or JRE) 8 or more recent
Expand Down
4 changes: 4 additions & 0 deletions package.json
Expand Up @@ -75,6 +75,10 @@
{
"language": "java",
"path": "./snippets/quarkus.json"
},
{
"language": "quarkus-properties",
"path": "./snippets/properties.json"
}
],
"configuration": {
Expand Down
13 changes: 13 additions & 0 deletions snippets/properties.json
@@ -0,0 +1,13 @@
{
"Add datasource properties": {
"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|}",
"quarkus.datasource.username=${3:developer}",
"quarkus.datasource.password=${4:developer}",
"quarkus.hibernate-orm.database.generation=${5|update,drop-and-create,create,drop,none|}"
],
"description": "Configure Quarkus datasource"
}
}

0 comments on commit 1414645

Please sign in to comment.