Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SQL Activity #1648

Open
mohdali opened this issue Oct 15, 2021 · 2 comments
Open

SQL Activity #1648

mohdali opened this issue Oct 15, 2021 · 2 comments
Labels
activity This issue relates to a workflows activity

Comments

@mohdali
Copy link
Member

mohdali commented Oct 15, 2021

I propose to introduce an ExecuteSql activity that can enable reading or writing data using an SQL query. The activity will have the following properties:

  • Lets the user select a connecrion on which to execute the query. The connections can be obtained form a provider. For example, provide the connection strings in Elsa configurations, or enumerate from a database, etc.
  • The execution can be in read mode or write mode.
    • Read mode will execute a select query and return the result set.
    • Write mode will execute an insert or update query and return the number of affected rows.
  • The query will be parameterized so that the user can pass the workflow variables into the query
  • The data driver should be also pluggable, which allows the developer to select which data access library to use for executing the query.

As a plus, if Elsa designer can be extended to support SQL syntax it will allow syntax highlighting and possibly code completion while building the query.

@jwillmer jwillmer added the activity This issue relates to a workflows activity label Oct 18, 2021
@jwillmer jwillmer changed the title Proposal: ExecuteSQL Activity SQL Activity Oct 21, 2021
@tomy2105
Copy link
Contributor

I like the proposal but read and write mode is a bit of confusing since both delete, insert and update can return a result set same as select.

In addition I would, maybe, not fetch whole result set at once but block to browse through result set (forward, backward, etc...) and fetch as it executes. Fetching everything for big result sets could be bad.

@mohdali
Copy link
Member Author

mohdali commented May 31, 2022

I like the proposal but read and write mode is a bit of confusing since both delete, insert and update can return a result set same as select.

In addition I would, maybe, not fetch whole result set at once but block to browse through result set (forward, backward, etc...) and fetch as it executes. Fetching everything for big result sets could be bad.

Since we now have the SQL activity we can probably start thinking about this.

I like the idea to make the activity a kind of a blocking iterator.

I also want to have a kind of bulk operations that will be more efficient with large data.

We may need to also support more DB types. Oracle is could be next.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
activity This issue relates to a workflows activity
Projects
None yet
Development

No branches or pull requests

3 participants