Merge pull request #491 from juvarabrera/update-readme

docs: Updated README.md. Discontinue mysql
This commit is contained in:
James Agnew
2023-02-04 15:04:18 -05:00
committed by GitHub

View File

@@ -177,35 +177,11 @@ Server will then be accessible at http://localhost:8080/ and eg. http://localhos
Much of this HAPI starter project can be configured using the yaml file in _src/main/resources/application.yaml_. By default, this starter project is configured to use H2 as the database. Much of this HAPI starter project can be configured using the yaml file in _src/main/resources/application.yaml_. By default, this starter project is configured to use H2 as the database.
### MySql configuration ### MySQL configuration
To configure the starter app to use MySQL, instead of the default H2, update the application.yaml file to have the following: HAPI FHIR JPA Server does not support MySQL as it is deprecated.
```yaml See more at https://hapifhir.io/hapi-fhir/docs/server_jpa/database_support.html
spring:
datasource:
url: 'jdbc:mysql://localhost:3306/hapi_dstu3'
username: admin
password: admin
driverClassName: com.mysql.jdbc.Driver
```
Also, make sure you are not setting the Hibernate dialect explicitly, in other words remove any lines similar to:
```
hibernate.dialect: {some none MySQL dialect}
```
On some systems, it might be necessary to override hibernate's default naming strategy. The naming strategy must be set using spring.jpa.hibernate.physical_naming_strategy.
```yaml
spring:
jpa:
hibernate.physical_naming_strategy: NAME_OF_PREFERRED_STRATEGY
```
On linux systems or when using docker mysql containers, it will be necessary to review the case-sensitive setup for
mysql schema identifiers. See https://dev.mysql.com/doc/refman/8.0/en/identifier-case-sensitivity.html. We suggest you
set `lower_case_table_names=1` during mysql startup.
### PostgreSQL configuration ### PostgreSQL configuration
@@ -214,7 +190,7 @@ To configure the starter app to use PostgreSQL, instead of the default H2, updat
```yaml ```yaml
spring: spring:
datasource: datasource:
url: 'jdbc:postgresql://localhost:5432/hapi_dstu3' url: 'jdbc:postgresql://localhost:5432/hapi'
username: admin username: admin
password: admin password: admin
driverClassName: org.postgresql.Driver driverClassName: org.postgresql.Driver
@@ -313,20 +289,21 @@ reached at http://localhost:8080/.
In order to use another port, change the `ports` parameter In order to use another port, change the `ports` parameter
inside `docker-compose.yml` to `8888:8080`, where 8888 is a port of your choice. inside `docker-compose.yml` to `8888:8080`, where 8888 is a port of your choice.
The docker compose set also includes my MySQL database, if you choose to use MySQL instead of H2, change the following The docker compose set also includes my PoPostgreSQL database, if you choose to use PostgreSQL instead of H2, change the following
properties in application.yaml: properties in `src/main/resources/application.yaml`:
```yaml ```yaml
spring: spring:
datasource: datasource:
url: 'jdbc:mysql://hapi-fhir-mysql:3306/hapi' url: 'jdbc:postgresql://hapi-fhir-postgres:5432/hapi'
username: admin username: admin
password: admin password: admin
driverClassName: com.mysql.jdbc.Driver driverClassName: org.postgresql.Driver
jpa:
properties:
hibernate.dialect: ca.uhn.fhir.jpa.model.dialect.HapiFhirPostgres94Dialect
``` ```
Also, make sure you are not setting the Hibernate Dialect explicitly, see more details in the section about MySQL.
## Running hapi-fhir-jpaserver directly from IntelliJ as Spring Boot ## Running hapi-fhir-jpaserver directly from IntelliJ as Spring Boot
Make sure you run with the maven profile called ```boot``` and NOT also ```jetty```. Then you are ready to press debug the project directly without any extra Application Servers. Make sure you run with the maven profile called ```boot``` and NOT also ```jetty```. Then you are ready to press debug the project directly without any extra Application Servers.
@@ -362,8 +339,6 @@ Run the configuration.
Point your browser (or fiddler, or what have you) to `http://localhost:8080/hapi/baseDstu3/Patient` Point your browser (or fiddler, or what have you) to `http://localhost:8080/hapi/baseDstu3/Patient`
It is important to use MySQL5Dialect when using MySQL version 5+.
## Enabling Subscriptions ## Enabling Subscriptions
The server may be configured with subscription support by enabling properties in the [application.yaml](https://github.com/hapifhir/hapi-fhir-jpaserver-starter/blob/master/src/main/resources/application.yaml) file: The server may be configured with subscription support by enabling properties in the [application.yaml](https://github.com/hapifhir/hapi-fhir-jpaserver-starter/blob/master/src/main/resources/application.yaml) file: