Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions ojdbc-provider-pkl/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Oracle JDBC Configuration Provider Parser for Pkl

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

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

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

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

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

connect_descriptor = "dbhost:1521/orclpdb1"
user = "scott"
Expand Down Expand Up @@ -78,7 +78,7 @@ jdbc:oracle:thin:@config-file://myJdbcConfig.pkl
#### myJdbcConfig.pkl

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

config1 = (JdbcConfig) {
connect_descriptor = "dbhost:1521/orclpdb1"
Expand Down
21 changes: 7 additions & 14 deletions ojdbc-provider-pkl/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,6 @@
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
</dependency>
<!-- TEST DEPENDENCIES -->
<dependency>
<groupId>com.oracle.database.jdbc</groupId>
<artifactId>ojdbc-provider-common</artifactId>
<classifier>tests</classifier>
<type>test-jar</type>
</dependency>
</dependencies>

<build>
Expand Down Expand Up @@ -73,15 +66,15 @@
</executions>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<testResources>
<testResource>
<directory>${basedir}/template</directory>
<includes>
<include>**/*.pkl</include>
<include>META-INF/services/oracle.jdbc.spi.*</include>
<include>JdbcConfig.pkl</include>
</includes>
</resource>
</resources>
</testResource>
</testResources>

</build>

</project>
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package oracle.jdbc.provider.pkl.configuration.generated;
package oracle.jdbc.provider.pkl.configuration;

import java.lang.Boolean;
import java.lang.Long;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package oracle.jdbc.provider.pkl.configuration;

import oracle.jdbc.provider.pkl.configuration.generated.JdbcConfig;
import oracle.jdbc.spi.OracleConfigurationParser;
import oracle.jdbc.spi.OracleConfigurationSecretProvider;
import org.pkl.config.java.Config;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public static void setup() throws Exception {
file = File.createTempFile("myJdbcConfig", ".pkl");
file.createNewFile();

URL resourceUrl = PklParser.class.getClassLoader().getResource(RESOURCE_NAME);
URL resourceUrl = Thread.currentThread().getContextClassLoader().getResource(RESOURCE_NAME);
if (resourceUrl == null) {
throw new RuntimeException("Resource not found: " + RESOURCE_NAME);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module oracle.jdbc.provider.pkl.configuration.generated.JdbcConfig
module oracle.jdbc.provider.pkl.configuration.JdbcConfig

connect_descriptor: String
user: String?
Expand Down