Skip to content

Commit

Permalink
Re-adds removed builder APIs and adds deprecation notice
Browse files Browse the repository at this point in the history
  • Loading branch information
johnedquinn committed Jan 2, 2024
1 parent c73efbf commit fcd061b
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
6 changes: 4 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ Thank you to all who have contributed!
## [Unreleased]

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

### Changed

Expand All @@ -44,6 +45,7 @@ Thank you to all who have contributed!
### Contributors
Thank you to all who have contributed!
- @rchowell
- @johnedquinn

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

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package org.partiql.planner

import org.partiql.spi.connector.ConnectorMetadata

/**
* PartiQLPlannerBuilder is used to programmatically construct a [PartiQLPlanner] implementation.
*
Expand Down Expand Up @@ -38,4 +40,29 @@ public class PartiQLPlannerBuilder {
public fun addPasses(vararg passes: PartiQLPlannerPass): PartiQLPlannerBuilder = this.apply {
this.passes.addAll(passes)
}

/**
* Java style method for assigning a Catalog name to [ConnectorMetadata].
*
* @param catalog
* @param metadata
* @return
*/
@Deprecated("This will be removed in v0.15.0+.", ReplaceWith("Please use org.partiql.planner.PartiQLPlanner.Session"))
public fun addCatalog(catalog: String, metadata: ConnectorMetadata): PartiQLPlannerBuilder = this

/**
* Kotlin style method for assigning Catalog names to [ConnectorMetadata].
*
* @param catalogs
* @return
*/
@Deprecated("This will be removed in v0.15.0+.", ReplaceWith("Please use org.partiql.planner.PartiQLPlanner.Session"))
public fun catalogs(vararg catalogs: Pair<String, ConnectorMetadata>): PartiQLPlannerBuilder = this

@Deprecated("This will be removed in v0.15.0+.", ReplaceWith("addPasses"))
public fun passes(passes: List<PartiQLPlannerPass>): PartiQLPlannerBuilder = this.apply {
this.passes.clear()
this.passes.addAll(passes)
}
}

0 comments on commit fcd061b

Please sign in to comment.