-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
107 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 1 addition & 26 deletions
27
partiql-eval/src/main/kotlin/org/partiql/eval/PartiQLEngineBuilder.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,11 @@ | ||
package org.partiql.eval | ||
|
||
import org.partiql.spi.connector.ConnectorBindings | ||
|
||
class PartiQLEngineBuilder { | ||
|
||
private var catalogs: MutableMap<String, ConnectorBindings> = mutableMapOf() | ||
|
||
/** | ||
* Build the builder, return an implementation of a [PartiQLEngine] | ||
* | ||
* @return | ||
*/ | ||
public fun build(): PartiQLEngine = PartiQLEngineDefault(catalogs) | ||
|
||
/** | ||
* Java style method for assigning a Catalog name to [ConnectorBindings]. | ||
* | ||
* @param catalog | ||
* @param bindings | ||
* @return | ||
*/ | ||
public fun addCatalog(catalog: String, bindings: ConnectorBindings): PartiQLEngineBuilder = this.apply { | ||
this.catalogs[catalog] = bindings | ||
} | ||
|
||
/** | ||
* Kotlin style method for assigning Catalog names to [ConnectorBindings]. | ||
* | ||
* @param catalogs | ||
* @return | ||
*/ | ||
public fun catalogs(vararg catalogs: Pair<String, ConnectorBindings>): PartiQLEngineBuilder = this.apply { | ||
this.catalogs = mutableMapOf(*catalogs) | ||
} | ||
public fun build(): PartiQLEngine = PartiQLEngineDefault() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters