File tree Expand file tree Collapse file tree 6 files changed +21
-21
lines changed
main/kotlin/com/github/mgramin/sqlboot/model
kotlin/com/github/mgramin/sqlboot/model/resourcetype/impl Expand file tree Collapse file tree 6 files changed +21
-21
lines changed Original file line number Diff line number Diff line change @@ -66,17 +66,17 @@ open class SimpleEndpoint(
6666 dataSource!!
6767 } else {
6868 val dataSourceNew = DataSource ()
69- if (properties().containsKey(" jdbc.url " )) {
70- dataSourceNew.url = properties()[" jdbc.url " ].toString()
69+ if (properties().containsKey(" jdbc_url " )) {
70+ dataSourceNew.url = properties()[" jdbc_url " ].toString()
7171 } else {
72- val jdbcProtocol = properties()[" jdbc.protocol " ]
73- val dbName = properties()[" db.name " ]
74- val dbPort = properties()[" db.port " ]
72+ val jdbcProtocol = properties()[" jdbc_protocol " ]
73+ val dbName = properties()[" db_name " ]
74+ val dbPort = properties()[" db_port " ]
7575 dataSourceNew.url = " $jdbcProtocol ://$host :$dbPort /$dbName "
7676 }
77- dataSourceNew.driverClassName = properties()[" jdbc.driver.class.name " ].toString()
78- dataSourceNew.username = properties()[" db.user " ].toString()
79- dataSourceNew.password = properties()[" db.password " ].toString()
77+ dataSourceNew.driverClassName = properties()[" jdbc_driver_class_name " ].toString()
78+ dataSourceNew.username = properties()[" db_user " ].toString()
79+ dataSourceNew.password = properties()[" db_password " ].toString()
8080 dataSourceNew.minIdle = 1
8181 dataSourceNew.maxActive = 3
8282 dataSourceNew.maxIdle = 3
Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ class FsResourceType(
7878 fun resourceTypes () = resourceTypes
7979
8080 private val resourceTypes: List <ResourceType > =
81- walk(FileSystemResource (endpoints.first().properties()[" fs.base.folder " ].toString()).file.path)
81+ walk(FileSystemResource (endpoints.first().properties()[" fs_base_folder " ].toString()).file.path)
8282
8383 private fun walk (path : String ) =
8484 File (path)
Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ class SqlResourceType(
8383 endpoints
8484 .map { connection ->
8585 return @map createQuery(uri, connection, specificDialect
86- ? : connection.properties()[" sql.dialect " ].toString()).execute(hashMapOf(" uri" to uri))
86+ ? : connection.properties()[" sql_dialect " ].toString()).execute(hashMapOf(" uri" to uri))
8787 .map<Map <String , Any >? > {
8888 val toMutableMap = it.toMutableMap()
8989 toMutableMap[" endpoint" ] = connection.name()
Original file line number Diff line number Diff line change @@ -63,10 +63,10 @@ class FsResourceTypeTest {
6363 dbMd.host = " 127.0.0.1"
6464 dbMd.properties = """
6565 {
66- "fs.base.folder ": "conf/h2/md/database",
67- "sql.dialect ": "h2",
68- "jdbc.url ": "jdbc:h2:mem:;INIT=RUNSCRIPT FROM 'classpath:schema.sql';",
69- "jdbc.driver.class.name ": "org.h2.Driver"
66+ "fs_base_folder ": "conf/h2/md/database",
67+ "sql_dialect ": "h2",
68+ "jdbc_url ": "jdbc:h2:mem:;INIT=RUNSCRIPT FROM 'classpath:schema.sql';",
69+ "jdbc_driver_class_name ": "org.h2.Driver"
7070 }
7171 """ .trimIndent()
7272 }
Original file line number Diff line number Diff line change @@ -61,9 +61,9 @@ class SqlResourceTypeTest {
6161 db.host = " 127.0.0.1"
6262 db.properties = """
6363 {
64- "sql.dialect ": "h2",
65- "jdbc.url ": "jdbc:h2:mem:;INIT=RUNSCRIPT FROM 'classpath:schema.sql';",
66- "jdbc.driver.class.name ": "org.h2.Driver"
64+ "sql_dialect ": "h2",
65+ "jdbc_url ": "jdbc:h2:mem:;INIT=RUNSCRIPT FROM 'classpath:schema.sql';",
66+ "jdbc_driver_class_name ": "org.h2.Driver"
6767 }
6868 """ .trimIndent()
6969 }
Original file line number Diff line number Diff line change @@ -10,10 +10,10 @@ conf:
1010 host : 127.0.0.1
1111 properties : >
1212 {
13- "sql.dialect ": "h2",
14- "fs.base.folder ": "conf/h2/md/database",
15- "jdbc.url ": "jdbc:h2:mem:;INIT=RUNSCRIPT FROM 'classpath:schema.sql';",
16- "jdbc.driver.class.name ": "org.h2.Driver",
13+ "sql_dialect ": "h2",
14+ "fs_base_folder ": "conf/h2/md/database",
15+ "jdbc_url ": "jdbc:h2:mem:;INIT=RUNSCRIPT FROM 'classpath:schema.sql';",
16+ "jdbc_driver_class_name ": "org.h2.Driver",
1717 "jdbc.user": "",
1818 "jdbc.password": "",
1919 "os.query.rest.port": "8082",
You can’t perform that action at this time.
0 commit comments