Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-17333

.NET: Thin 3.0: SQL ResultSet object mapping

    XMLWordPrintableJSON

Details

    • Hide
      Add `ISql.ExecuteAsync<T>` API, which maps SQL result set data to user types.

      Before that, we could insert and retrieve data in a strongly typed way with object mapping via `IRecordView<T>` API, but SQL results could only be accessed in a weakly typed way through `IgniteTuple` or `DbDataReader`. This change fills the void.

      Or, to put it another way, we could use LINQ to query data in a strongly typed manner. But not every query can be expressed in LINQ, sometimes we have to use raw SQL, but result mapping is still very useful, which is now possible.

      This is also the fastest way to retrieve query results (see benchmarks), because there is no LINQ translation, but compiled delegates read the data with the lowest possible overhead.
      Show
      Add `ISql.ExecuteAsync<T>` API, which maps SQL result set data to user types. Before that, we could insert and retrieve data in a strongly typed way with object mapping via `IRecordView<T>` API, but SQL results could only be accessed in a weakly typed way through `IgniteTuple` or `DbDataReader`. This change fills the void. Or, to put it another way, we could use LINQ to query data in a strongly typed manner. But not every query can be expressed in LINQ, sometimes we have to use raw SQL, but result mapping is still very useful, which is now possible. This is also the fastest way to retrieve query results (see benchmarks), because there is no LINQ translation, but compiled delegates read the data with the lowest possible overhead.
    • Docs Required, Release Notes Required

    Description

      Table API provides object mapping capabilities:

      IRecordView<Person> mappedView = Table.GetRecordView<Person>();
      Person res = await mappedView.GetAsync(...);
      

      This is cleaner and more efficient than working with *IgniteTuple*s (less allocations and type casts).

      Implement similar functionality for SQL API - see ISql.ExecuteAsync<T>.

      Attachments

        Issue Links

          Activity

            People

              ptupitsyn Pavel Tupitsyn
              ptupitsyn Pavel Tupitsyn
              Igor Sapego Igor Sapego
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 20m
                  20m