Skip to content

Find Alternative to SqlDataAdapter #4

Open
@sophiatev

Description

@sophiatev

We currently use SqlDataAdapter for both the input binding in the SqlConverters class and for the output binding in the SqlAsyncCollector class. The reason we do so is because SqlDataAdapter supports auto-generation of Insert and Update commands, which is useful for the output binding. We don't have to deal with discovering the table schema, manually generating an upsert command based on what columns are the primary keys, etc., since there is already functionality in place to do that for us. Another advantage is that it is possible to directly serialize/deserialize JSON to/from a DataTable. This makes it easy to convert the JSON string representing the rows the user wants upserted into a format that can then be directly manipulated by internal SQL libraries. Similarly, we can convert the rows we get back from input binding queries into POCOs easily. Otherwise, we would have to find alternative ways to convert between JSON and a SQL row, and then perform the insertion/reading of that row ourselves.

That being said, it doesn't seem like the SQL team is currently doing much to maintain/update the SqlDataAdapter, and it doesn't have support yet for asynchronous operations (although the issue is being tracked). Ideally, we should move away from SqlDataAdapter to something that is more maintained by the SQL team and supports asynchronous operations.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions