snowflakedb / snowpark-java-scala

Snowflake Snowpark Java & Scala API
Apache License 2.0
18 stars 20 forks source link

SNOW-802270: SessionBuilder should use the builder pattern #24

Open sfc-gh-jfreeberg opened 1 year ago

sfc-gh-jfreeberg commented 1 year ago

We got some feedback that that the pattern of passing a Map<String, String> is not best practice. Let's update the Builder class to support the following:

Java

Session session = Session.builder()
    .url("myaccount.snowflakecomputing.com")
    .user("myusername")
    .password(myPassword)
    .role("admin")
    .warehouse("my_wh")
    .database("my_db")
    .schema("my_schema")
    .create()

Scala

val session = Session.builder
    .url("myaccount.snowflakecomputing.com")
    .user("myusername")
    .password(myPassword)
    .role("admin")
    .warehouse("my_wh")
    .database("my_db")
    .schema("my_schema")
    .create

This is tangentially related to #1

Open questions: