Skip to content

Commit 0cb8559

Browse files
Update readme and move JdbcConfig.pkl from resources/ to template/ (#228)
* Update readme and move JdbcConfig.pkl from resources/ to template/ * Update readme
1 parent ae54774 commit 0cb8559

File tree

6 files changed

+14
-22
lines changed

6 files changed

+14
-22
lines changed

ojdbc-provider-pkl/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Oracle JDBC Configuration Provider Parser for Pkl
22

3-
This module provides a parser that integrates **Oracle JDBC** with **Pkl**, a modern configuration language.
3+
This module provides a parser that integrates **Oracle JDBC** with **[Pkl](https://pkl-lang.org/index.html)**, a modern configuration language.
44
It implements the `OracleConfigurationParser` interface to parse and read `.pkl` files for database configuration.
55

66
With the Oracle JDBC Pkl Parser, developers can store JDBC configurations in `.pkl` files and load them dynamically through Oracle JDBC Driver Extensions.
@@ -10,7 +10,7 @@ With the Oracle JDBC Pkl Parser, developers can store JDBC configurations in `.p
1010
## Installation
1111

1212
All providers in this module are distributed as single jar on the Maven Central
13-
Repository. The jar is compiled for JDK 8, and is forward compatible with later
13+
Repository. The jar is compiled for JDK 17 (as required by Pkl), and is forward compatible with later
1414
JDK versions. The coordinates for the latest release are:
1515

1616
```xml
@@ -48,7 +48,7 @@ There are two approaches to filling out a template: **amends** and **import**.
4848
#### myJdbcConfig.pkl
4949

5050
```yaml
51-
amends "https://raw.githubusercontent.com/oracle/ojdbc-extensions/ojdbc-provider-pkl/src/main/resources/JdbcConfig.pkl"
51+
amends "https://raw.githubusercontent.com/oracle/ojdbc-extensions/refs/heads/main/ojdbc-provider-pkl/template/JdbcConfig.pkl"
5252

5353
connect_descriptor = "dbhost:1521/orclpdb1"
5454
user = "scott"
@@ -78,7 +78,7 @@ jdbc:oracle:thin:@config-file://myJdbcConfig.pkl
7878
#### myJdbcConfig.pkl
7979

8080
```yaml
81-
import "https://raw.githubusercontent.com/oracle/ojdbc-extensions/ojdbc-provider-pkl/src/main/resources/JdbcConfig.pkl"
81+
import "https://raw.githubusercontent.com/oracle/ojdbc-extensions/refs/heads/main/ojdbc-provider-pkl/template/JdbcConfig.pkl"
8282

8383
config1 = (JdbcConfig) {
8484
connect_descriptor = "dbhost:1521/orclpdb1"

ojdbc-provider-pkl/pom.xml

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,6 @@
3636
<groupId>org.junit.jupiter</groupId>
3737
<artifactId>junit-jupiter-engine</artifactId>
3838
</dependency>
39-
<!-- TEST DEPENDENCIES -->
40-
<dependency>
41-
<groupId>com.oracle.database.jdbc</groupId>
42-
<artifactId>ojdbc-provider-common</artifactId>
43-
<classifier>tests</classifier>
44-
<type>test-jar</type>
45-
</dependency>
4639
</dependencies>
4740

4841
<build>
@@ -73,15 +66,15 @@
7366
</executions>
7467
</plugin>
7568
</plugins>
76-
<resources>
77-
<resource>
78-
<directory>src/main/resources</directory>
69+
<testResources>
70+
<testResource>
71+
<directory>${basedir}/template</directory>
7972
<includes>
80-
<include>**/*.pkl</include>
81-
<include>META-INF/services/oracle.jdbc.spi.*</include>
73+
<include>JdbcConfig.pkl</include>
8274
</includes>
83-
</resource>
84-
</resources>
75+
</testResource>
76+
</testResources>
77+
8578
</build>
8679

8780
</project>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package oracle.jdbc.provider.pkl.configuration.generated;
1+
package oracle.jdbc.provider.pkl.configuration;
22

33
import java.lang.Boolean;
44
import java.lang.Long;

ojdbc-provider-pkl/src/main/java/oracle/jdbc/provider/pkl/configuration/PklParser.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package oracle.jdbc.provider.pkl.configuration;
22

3-
import oracle.jdbc.provider.pkl.configuration.generated.JdbcConfig;
43
import oracle.jdbc.spi.OracleConfigurationParser;
54
import oracle.jdbc.spi.OracleConfigurationSecretProvider;
65
import org.pkl.config.java.Config;

ojdbc-provider-pkl/src/test/java/oracle/jdbc/provider/pkl/configuration/PklParserTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public static void setup() throws Exception {
7474
file = File.createTempFile("myJdbcConfig", ".pkl");
7575
file.createNewFile();
7676

77-
URL resourceUrl = PklParser.class.getClassLoader().getResource(RESOURCE_NAME);
77+
URL resourceUrl = Thread.currentThread().getContextClassLoader().getResource(RESOURCE_NAME);
7878
if (resourceUrl == null) {
7979
throw new RuntimeException("Resource not found: " + RESOURCE_NAME);
8080
}

ojdbc-provider-pkl/src/main/resources/JdbcConfig.pkl renamed to ojdbc-provider-pkl/template/JdbcConfig.pkl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module oracle.jdbc.provider.pkl.configuration.generated.JdbcConfig
1+
module oracle.jdbc.provider.pkl.configuration.JdbcConfig
22

33
connect_descriptor: String
44
user: String?

0 commit comments

Comments
 (0)