Getting only first row from SQL connector
See original GitHub issueThis is a…
[ ] Feature request
[ ] Regression (a behavior that used to work and stopped working in a new release)
[x] Bug report
[ ] Documentation issue or request
The problem
Seems that we’re only passing the first row of an result set down the exchange.
It might be because we wanted to split and process (map?) each row individually but I can’t find how this would be done in the code.
This is quite an issue for API provider-based integrations and API’s that would fetch more than one row from the database, say to implement GET /task
endpoint.
To address this we should probably set the output data shape of the SQL connector to something like:
{
"results": [
{"col1":"data1"},
{"col2":"data2"}
]
}
So this would mean change the dynamic data shape generation (meta) and change in the SqlConnectorCustomizer::doAfterProducer
.
Expected behavior
Put all rows on the exchange.
Tasks involved / Steps to Reproduce
- create timer to log integration (logging body)
- add invoke SQL action, using sample db connection with
select * from todo
SQL statement - insert two or more rows into the sampledb.todo table
- notice that only the first row is logged
Issue Analytics
- State:
- Created 5 years ago
- Comments:55 (30 by maintainers)
Top Results From Across the Web
SQL TOP , LIMIT , FETCH FIRST or ROWNUM Clause
The SQL SELECT TOP Clause ; SQL Server / MS Access Syntax: · TOP number|percent column_name(s) FROM table_name. WHERE condition; ; MySQL Syntax:...
Read more >4 Ways to Join Only The First Row in SQL - Sisense
To solve this problem, we need to join only the first row. There are several ways to do this. Here are a few...
Read more >Get single row from SQL Server - Power Platform Community
There are two connectors I see. One for 'Get Row' which seems like it only takes an actual row number, which isn't really...
Read more >How to get only the first row from a java.sql.ResultSet?
String yourQuery = "select * from some_table"; PreparedStatement statement = connection.prepareStatement(yourQuery); statement.setMaxRows(1); rs ...
Read more >How to select first row from a join that returns multple rows on ...
I want to only show the first email per person. Presently I get multiple rows per person because they have multiple emails. I...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think we need to work on https://github.com/syndesisio/syndesis/issues/4337 to properly solve this. The idea is that the DataShape describe the shape of the elements of the collection and then we do add some metadata/tag to the DataShape definition to tell UI/DataMapper that the action produces a collection.
How this flag is consumed is not yet defined
So I put this to a test and to my amazement both versions
worked in the exact same way!
What I did:
Also published the integration once again and it also worked as before.