Skip to content

Commit 8253053

Browse files
authored
Merge pull request #1327 from partiql/deprecates-builder-apis
Re-adds removed builder APIs and adds deprecation notice
2 parents 7fe57b5 + fcd061b commit 8253053

File tree

2 files changed

+31
-2
lines changed

2 files changed

+31
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ Thank you to all who have contributed!
2828
## [Unreleased]
2929

3030
### Added
31-
- Adds the ability to define a user-defined-function in ConnectorMetadata
32-
- Move ConnectorMetadata map from PartiQLPlanner to PartiQLPlanner.Session for planner re-use.
31+
- Adds the ability to define a user-defined-function in `ConnectorMetadata`
32+
- Move `ConnectorMetadata` map from `PartiQLPlanner` to `PartiQLPlanner.Session` for planner re-use.
33+
- Deprecates 2 APIs in `org.partiql.planner.PartiQLPlannerBuilder` in favor of using the ConnectorMetadata map in `PartiQLPlanner.Session`.
3334

3435
### Changed
3536

@@ -44,6 +45,7 @@ Thank you to all who have contributed!
4445
### Contributors
4546
Thank you to all who have contributed!
4647
- @rchowell
48+
- @johnedquinn
4749

4850
## [0.14.0-alpha] - 2023-12-15
4951

partiql-planner/src/main/kotlin/org/partiql/planner/PartiQLPlannerBuilder.kt

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package org.partiql.planner
22

3+
import org.partiql.spi.connector.ConnectorMetadata
4+
35
/**
46
* PartiQLPlannerBuilder is used to programmatically construct a [PartiQLPlanner] implementation.
57
*
@@ -38,4 +40,29 @@ public class PartiQLPlannerBuilder {
3840
public fun addPasses(vararg passes: PartiQLPlannerPass): PartiQLPlannerBuilder = this.apply {
3941
this.passes.addAll(passes)
4042
}
43+
44+
/**
45+
* Java style method for assigning a Catalog name to [ConnectorMetadata].
46+
*
47+
* @param catalog
48+
* @param metadata
49+
* @return
50+
*/
51+
@Deprecated("This will be removed in v0.15.0+.", ReplaceWith("Please use org.partiql.planner.PartiQLPlanner.Session"))
52+
public fun addCatalog(catalog: String, metadata: ConnectorMetadata): PartiQLPlannerBuilder = this
53+
54+
/**
55+
* Kotlin style method for assigning Catalog names to [ConnectorMetadata].
56+
*
57+
* @param catalogs
58+
* @return
59+
*/
60+
@Deprecated("This will be removed in v0.15.0+.", ReplaceWith("Please use org.partiql.planner.PartiQLPlanner.Session"))
61+
public fun catalogs(vararg catalogs: Pair<String, ConnectorMetadata>): PartiQLPlannerBuilder = this
62+
63+
@Deprecated("This will be removed in v0.15.0+.", ReplaceWith("addPasses"))
64+
public fun passes(passes: List<PartiQLPlannerPass>): PartiQLPlannerBuilder = this.apply {
65+
this.passes.clear()
66+
this.passes.addAll(passes)
67+
}
4168
}

0 commit comments

Comments
 (0)