Skip to content

Commit

Permalink
#: Add cockroachdb adapt
Browse files Browse the repository at this point in the history
  • Loading branch information
zdu-strong committed Jan 20, 2025
1 parent 2eab6f9 commit a07c972
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
5 changes: 4 additions & 1 deletion springboot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ Projects created by start.spring.io contain Spring Boot, a framework that makes
1. From https://adoptium.net install java v21, and choose Entire feature.<br/>
2. From https://code.visualstudio.com install Visual Studio Code.<br/>
Next, install extension "XML" and "Extension Pack for Java".<br/>
3. From https://dev.mysql.com/downloads/installer install MySQL, the password of the root user is set to 123456.<br/>
3. From https://www.docker.com install docker. Next, run the command:<br/>

docker run -d -p 26257:26257 cockroachdb/cockroach start-single-node --insecure --listen-addr=:26257

4. Optional.<br/>
From https://dbeaver.io install DBeaver.<br/>

Expand Down
20 changes: 11 additions & 9 deletions springboot/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,27 @@
<properties>
<java.version>21</java.version>
<resource.delimiter>${}</resource.delimiter>
<database.jdbc.url>127.0.0.1:3306</database.jdbc.url>
<database.name>springboot_dev</database.name>
<database.jdbc.url>127.0.0.1:26257</database.jdbc.url>
<database.name>defaultdb</database.name>
<database.username>root</database.username>
<database.password>123456</database.password>
<database.driver>com.mysql.cj.jdbc.Driver</database.driver>
<database.platform>com.springboot.project.common.database.CustomMySQLDialect</database.platform>
<database.driver>org.postgresql.Driver</database.driver>
<database.platform>com.springboot.project.common.database.CustomCockroachdbDialect</database.platform>
<storage.cloud.aliyun.enabled>false</storage.cloud.aliyun.enabled>
<storage.cloud.aliyun.endpoint></storage.cloud.aliyun.endpoint>
<storage.cloud.aliyun.bucketName></storage.cloud.aliyun.bucketName>
<storage.cloud.aliyun.accessKeyId></storage.cloud.aliyun.accessKeyId>
<storage.cloud.aliyun.accessKeySecret></storage.cloud.aliyun.accessKeySecret>
<database.spring.jpa.hibernate.ddl.auto>validate</database.spring.jpa.hibernate.ddl.auto>
<database.spring.liquibase.enabled>true</database.spring.liquibase.enabled>
<database.spring.jpa.hibernate.ddl.auto>update</database.spring.jpa.hibernate.ddl.auto>
<database.spring.liquibase.enabled>false</database.spring.liquibase.enabled>
<database.spring.datasource.url>
jdbc:mysql://${database.jdbc.url}/${database.name}?useUnicode=true&amp;characterEncoding=utf-8&amp;serverTimezone=UTC&amp;createDatabaseIfNotExist=true
jdbc:postgresql://${database.jdbc.url}/${database.name}
</database.spring.datasource.url>
<database.sql.maven.plugin.url>${database.spring.datasource.url}</database.sql.maven.plugin.url>
<database.sql.maven.plugin.url>
jdbc:postgresql://${database.jdbc.url}/system
</database.sql.maven.plugin.url>
<database.liquibase.maven.plugin.reference.url>
jdbc:mysql://${database.jdbc.url}/${env.LIQUIBASE_REFERENCE_DATABASE_NAME}?useUnicode=true&amp;characterEncoding=utf-8&amp;serverTimezone=UTC&amp;createDatabaseIfNotExist=true
jdbc:postgresql://${database.jdbc.url}/${env.LIQUIBASE_REFERENCE_DATABASE_NAME}
</database.liquibase.maven.plugin.reference.url>
<is.development.mock.mode>true</is.development.mock.mode>
<google-cloud-spanner-jdbc.version>2.25.2</google-cloud-spanner-jdbc.version>
Expand Down

0 comments on commit a07c972

Please sign in to comment.