Forum Discussion
richie
Community Hero
Hey ameesh1984
Oh yeah it does...you can SELECT, INSERT, UPDATE and DELETE straightforward enough via the relevant http methods that are supported.
All im saying is that you are limited in the level of complexity for the queries you can execute. For example. If you wanted to join two tables but the referential columns in the tables had different datatypes you wouldnt be able to CAST to convert the one column to an appropriate datatype. Im using this example because it was one of the things i tried to do when i was querying a cloud based DB via REST. Another example. I couldnt update the data in one table based on the contents of the other table in others cos when you do this in SQL you need to use a subquery to do it and this wasnt supported.
It simply depends on the complexity and functions youd need to execute im guessing. If the equivalent SQL queries are reasonably basic then the REST API does the job. If what youre testing requires complex queries it wont.
Can you describe briefly what you need to test? Are you publishing messages to a webservice that updates the cosmos database. If you were testing something like this then basic queries will probably suffice. If you are testing a system where the quality of the test data is a concern then perhaps basic queries wont suffice. This is what ive found in my experience of doing this.
Cheers
Rich
Oh yeah it does...you can SELECT, INSERT, UPDATE and DELETE straightforward enough via the relevant http methods that are supported.
All im saying is that you are limited in the level of complexity for the queries you can execute. For example. If you wanted to join two tables but the referential columns in the tables had different datatypes you wouldnt be able to CAST to convert the one column to an appropriate datatype. Im using this example because it was one of the things i tried to do when i was querying a cloud based DB via REST. Another example. I couldnt update the data in one table based on the contents of the other table in others cos when you do this in SQL you need to use a subquery to do it and this wasnt supported.
It simply depends on the complexity and functions youd need to execute im guessing. If the equivalent SQL queries are reasonably basic then the REST API does the job. If what youre testing requires complex queries it wont.
Can you describe briefly what you need to test? Are you publishing messages to a webservice that updates the cosmos database. If you were testing something like this then basic queries will probably suffice. If you are testing a system where the quality of the test data is a concern then perhaps basic queries wont suffice. This is what ive found in my experience of doing this.
Cheers
Rich
ameesh1984
4 years agoContributor
We are testing web services and the responses of those we will compare with the cosmos db data we fetch via rest api mentioned
- richie4 years agoCommunity HeroHey ameesh1984,
In that case you should be able to do what you need.
Youll just perform the methods that your webservice supports (to create, update and delete records) and then follow up with a simple GET to the db API to verify the records were created, updated and deleted appropriately. At most im guessing youll need to JOIN but that is supported so it sounds like you have all your boxes ticked.
Nice one,
Rich
Related Content
Recent Discussions
- 16 hours agoGuhan-B
- 5 days agoruchisingh