You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ignite.apache.org by "Konstantin Orlov (Jira)" <ji...@apache.org> on 2024/03/15 09:56:00 UTC

[jira] [Assigned] (IGNITE-21669) Remove sessions from SQL API

     [ https://issues.apache.org/jira/browse/IGNITE-21669?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Konstantin Orlov reassigned IGNITE-21669:
-----------------------------------------

    Assignee: Konstantin Orlov

> Remove sessions from SQL API
> ----------------------------
>
>                 Key: IGNITE-21669
>                 URL: https://issues.apache.org/jira/browse/IGNITE-21669
>             Project: Ignite
>          Issue Type: Improvement
>          Components: sql
>            Reporter: Igor Sapego
>            Assignee: Konstantin Orlov
>            Priority: Major
>              Labels: ignite-3
>
> Currently, {{org.apache.ignite.sql.Session}} interface does not bring any value, and can be confusing for the users:
> * It is simply a property bag and does not hold any other state across queries;
> * The same properties can be set on {{Statement}};
> * {{createSession}} is an extra step for the user;
> * Some people, even AI3 developers, look at this API and assume something more, like holding open transactions on the server, etc.
> To do:
> # Move query execution methods from Session to IgniteSql;
> # Remove Session interface.
> {code:java}
> public interface IgniteSql {
>    ResultSet<SqlRow> execute(@Nullable Transaction transaction, String query, @Nullable Object... arguments);
>    ResultSet<SqlRow> execute(@Nullable Transaction transaction, Statement statement, @Nullable Object... arguments);
>    Statement.StatementBuilder statementBuilder();
>    ...
> }
> {code}
> Usage examples: 
> {code:java}
> // Simple query in one line.
> sql.execute(null, "delete from my-table where id = ?", 1);
> // Statement.
> Statement statement = sql.statementBuilder()
>        .query("select foo from bar")
>        .pageSize(123)
>        .defaultSchema("my-schema")
>        .build();
> ResultSet<SqlRow> result = sql.execute(null, statement);
> // Statement as a template (instead of Session as a common property holder).
> Statement statement2 = statement.toBuilder()
>        .query("select foo from baz")
>        .build();
> {code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)