Commit Graph

95 Commits

Author SHA1 Message Date
Trisha Anand
cbf7dc2745
feat: New Mongo UQI Plugin with new datastructures (with old UI) (#6666) 2021-09-02 14:00:18 +00:00
Trisha Anand
f6df16bde4
fix: Json smart substitution breaks when evaluated value contains the character '?' (#7031)
* Minor refactoring

* Partial code change to replace question mark with appsmith placeholder

* Working version

* Removing unnecessary code

* Added test case to assert that when evaluated value contains a "?", the replacements are still correct

* Added test case in Mongo Plugin as well for the same scenario

* Minor change in the language of the comment
2021-09-02 12:30:04 +00:00
Trisha Anand
104fd168de
Distinct command output now results a JSON object instead of an array of strings (#6964) 2021-08-30 12:37:13 +00:00
Trisha Anand
23ce13ce98
[Mongo] Added default values for query for Find, Count and Distinct commands (#6960)
* Added smart defaults for query in Count, Distinct & Find commands

* Added test cases for smart inputs for query and limit for find, and query for count and distinct
2021-08-30 11:02:48 +00:00
Nidhi
f2cba9a601
Escaped inputs for bson substitution (#6565) 2021-08-13 14:44:51 +05:30
Trisha Anand
b4b1706946
BSON documents for aggregate pipelines are not valid JSON. Using BSON parse instead of JSON parse to ensure valid Mongo commands don't throw an error (#6583) 2021-08-13 08:00:34 +00:00
Abhijeet
9633d1e1c3
Add autogenerate field in datasource structure for each column (#6018)
* Added field to autogenerate values in DB column

* Added comment and refactor

* Autogenerate field update according to names instead of type for ArangoDB
2021-07-23 09:00:32 +05:30
Trisha Anand
18fa47e2b4
Taking Smart Substitution for Mongo out of Beta (#5650) 2021-07-08 11:25:53 +05:30
Trisha Anand
9dfe66d45c
[Bug] Mongo Plugin : Handle socket exception when the connection is dropped by Mongo database (#5499) 2021-07-01 17:23:24 +05:30
Trisha Anand
02e5445731
[Mongo Plugin] Raw is now a command option instead of Form vs Raw (#5446)
* Raw is now a command option instead of Form vs Raw

* Added database migration for migration raw input type to be of raw command type

* Fixed test case failure

* Minor cleanup
2021-06-29 11:13:17 +05:30
Nidhi
57adbd7777
Schema info in templates query (#5244) 2021-06-18 11:31:17 +05:30
Trisha Anand
388418cec5
Merge the two update commands into a single update command in Mongo Form (#5171)
* Update commands have been merged into a single update command for both single and multi updates

* Added migrations to migrate any update one mongo form command to new update command

* Incorporated review comments
2021-06-18 11:04:39 +05:30
Trisha Anand
77e965523c
[Feature] Smart Substitution for JSON fields in Mongo Form (#5136)
* Reduced verbosity of the command names for Insert, Find and Delete

* WIP : Smart substitution untested changes for mongo form

* Tested code for smart substitution working for mongo form fields

* Added test case for assert for smart substitution
2021-06-16 13:31:00 +05:30
Trisha Anand
06cafb6066
Getting Prepared Statement for Postgres, MySQL, and MS-SQL and Smart Substitution for Rest API plugins out of beta (#5019)
* Correcting text for Mongo Form Insert command

* Getting Prepared Statement for Postgres, MySQL, and MS-SQL and Smart Substitution for Rest API plugins out of beta

* Fixed failing test case

* Fixed Ms-sql plugin test failure
2021-06-10 13:55:56 +05:30
Abhijeet
0246563bd2
Bugfix for applications with MongoDB datasources authenticated with SRV string (#4944)
* Avoid updating authenticationDTO for mongo-plugin with SRV if the authentication object is already present
2021-06-10 10:52:23 +05:30
Trisha Anand
1bb54b0c7c
[Bug Fix] : Mongo Form Find - Projection field is parsed correctly (#4976)
* Parsing the field projection in Mongo Form

* Added test case to assert Projection field working.
2021-06-08 19:27:55 +05:30
Trisha Anand
d5e5be5d6a
[Feature] Mongo Form (#4378) 2021-05-19 11:05:24 +05:30
Sumit Kumar
247e5d7ea4
Feature: return prepared stmt / smart substitution params under request params section for debugging (#4421)
- return prepared stmt / smart substitution params under request params section for debugging
2021-05-17 08:59:17 +05:30
Sumit Kumar
e74d99b794
fix NPE (#4448)
fix NPE
2021-05-13 11:59:43 +05:30
Sumit Kumar
0ec3604eac
Feature: connect to mongo db via connection string URI (#4131)
allow user to connect using a mongo connection string URI directly.
2021-05-10 10:35:45 +05:30
Sumit Kumar
52bfd25824
Feature: return request parameters with type for debug tab (#4078)
- return request parameters with type for debug tab.
- request params are stored in a RequestParamDTO object.
- a configProperty -> label map is cached in pluginService, which returns the param label as per the configProperty it is mapped to via editor.json file.
- This feature currently only works with prepared statements disabled.
2021-04-30 16:26:51 +05:30
Sumit Kumar
275843e61a
Fix: Return helpful error message when get structure fails for mongo db due to lack of read permission. (#4077)
- return helpful error message when get structure fails for mongo db due to lack of read permission. The message returned is: Appsmith has failed to get database structure. Please provide read permission on the database to fix this.
- any get structure error is also generically being caught by the getStrucuture method in DatasourceStructureSolution.java
- error msg and status code is now returned as part of DatasourceStructure object.
- ErrorDTO is used to store error info.
- ErrorDTO definition is moved to appsmith-interfaces package so that it can be used all packages.
- Other changes:
  - stop logging PLUGIN_GET_STRUCTURE_ERROR externally, as this error is mostly triggered by credentials error or -lack of read permission.
  - start logging PLUGIN_GET_STRUCTURE_TIMEOUT_ERROR externally, because this is not a user error.
2021-04-26 11:18:08 +05:30
Shrikant Sharat Kandula
2971324be6
Fix unable to connect to MongoDB without username (#4130) 2021-04-23 18:21:36 +05:30
Trisha Anand
dd00f51808
Type Migration for Plugins Part 2 : Migration of existing actions + revert hotfix for editor.json (#4085)
* WIP :  Migration of data type for smart substitution configuration

* Fixed the migration code. Also reverted editor.jsons  back to equality check after migrations of existing actions

* Only fetching actions for plugins which belong to supported plugins.

* Setting a default value of "false" for all the actions which don't have a valid configuration for smart substitution.

* Minor code formatting

* Minor language change in comment

* Removed debug logs
2021-04-22 12:07:25 +05:30
Trisha Anand
30a82c2d24
Hotfix for broken release. Would do a proper fix on release tomorrow with migration (#4075) 2021-04-20 18:54:34 +05:30
Trisha Anand
eeaa26a7cc
Type migration from String to Object for plugin specified templates to preserve boolean and any other future data types (#4053)
* WIP : Type migration from String to Object for value

* Migrating config from string to boolean for prepared statement.
Handled error for already stored actions where PS config is stored as String and not Boolean.
2021-04-20 16:09:48 +05:30
Trisha Anand
9b49308abe
Adding dependency relationship to plugins (#3997)
* Added dependencies to be added to dependencyMap on client to Postgres, MSSQL, MySQL and Mongo plugins

* Added Dependency config for API

* Fixed the test case
2021-04-15 11:36:41 +05:30
Sumit Kumar
9c8bce0415
Feature: return data types of returned data on query execution for better data display (#3914)
- Return data type list along with action execution result so that the data can be displayed in the correct format.
- Handles these three data types for now : table, json, raw.
  - If a plugin has already assigned the data type, then common handler is not used.
  - Mongo plugin assigns the data types in the plugin specific flow i.e. does not use the common data type parse / assign method.
- To address review comments:
  - added a new enum ActionResultDataType for data types. It is consumed by ParsedDataType. A list of ParsedDataType is returned by ActionExecutionResult
  - parsed data in parallel using streams.parallel().
2021-04-09 10:58:37 +05:30
Sumit Kumar
41e44eed30
Feature: add title to action execution errors to improve user experience (#3872)
- add title to action execution errors to improve user experience
    - all errors in AppsmithPluginErrors
    - action execution related errors in AppsmithError : NO_CONFIGURATION_FOUND_IN_DATASOURCE, INVALID_ACTION, INVALID_DATASOURCE, INVALID_DATASOURCE_CONFIGURATION - as these are the likely errors in an action execution flow (excluding plugin specific flow) that might result from faulty action / datasource configuration by a user.
    - title is returned as part of ActionExecutionResult.
    - title is set in ActionExecutionResult on failure during action execution.
    - In response to review comment - added a new BaseException class, so that both AppsmithException and AppsmithPluginException extend this base class. Also, refactored code to introduce setErrorInfo() function in ActionExecutionResult class to set its attributes.
- Some unrelated cleanup:
    - catch PoolInitializationException for Postgres plugin and return AppsmithPuginException
    - catch MongoTimeoutException and return AppsmithPluginException
2021-04-08 09:49:05 +05:30
Hetu Nandu
28995e5b53
Fix PS and smart substitute true false value (#3896) 2021-04-07 16:06:17 +05:30
Hetu Nandu
5a1584377b
Update editor.json for Postgres, Mongo, MySQL, MS-SQL adding evaluation type (#3884)
Co-authored-by: Trisha Anand <trisha@appsmith.com>
2021-04-06 18:27:51 +05:30
Trisha Anand
4a087b172c
Feature : BSON Smart Substitution in Mongo Plugin (#3804)
* Feature : JSON Smart Substitution in Mongo Plugin

* Added BSON data type for Mongo substitution. Added test case

* Minor comment added

* Minor variable re-naming and correcting failing test cases.

* REST API : Escaping special characters in string before smart substitution

* Incorporated review comment
2021-04-05 17:12:29 +05:30
Sumit Kumar
00bcac7591
add support for 'prefer' ssl mode in postgresql. (#3848)
- add support for 'Prefer' ssl option for postgres plugin.
2021-04-05 15:51:17 +05:30
Sumit Kumar
38c5639542
Provide non client certificate based SSL support for Mysql, Mongo, Postgres plugins. (#3518)
- Provide non client certificate based SSL support for Mysql, Mongo, Postgres plugins.
- Added a new option default, apart from the the SSL mode types supported by the driver. Default means that go with whatever default configuration driver provides.
2021-03-19 15:03:56 +05:30
Trisha Anand
217e36aaa9
Enrichment of analytics event for execute. (#3492)
* WIP : enrichment of analytics event for execute.

* Plugin level : Catch all exceptions and set request in the result
Server level : Adding new fields to analytics : `isSuccessfulExecution`, `statusCode`, `timeElapsed`

* Dont catch StaleConnectionException. Server handles the same.

* Removed class specification for onErrorResume in plugins since its supposed to catch all errors.
2021-03-11 15:40:07 +05:30
Sumit Kumar
b6961ce7a4
Add timeout failure for mongo plugin test datasource (#3431)
- Mongo plugin client driver does not return with exception upon first failure - instead it keeps retrying. Hence, adding timeout error to report failure before the client thread cancels due to delay in response.
- It seems that the mongdb connection string cannot be directly used for ping test, hence skipping it.
2021-03-10 11:11:14 +05:30
Sumit Kumar
639913703a
Fix/add mongo srv support (#3341)
Provide helpful error msg when srv url is provided to mongo plugin

Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com>
2021-03-03 18:31:04 +05:30
Sumit Kumar
e5586a590a
fix placeholderText label in form.json files (#3331)
fix placeholderText label in form.json files
2021-03-03 09:33:02 +05:30
Trisha Anand
91e308665b
Requests preparation by plugins instead of ActionService (#3159)
* Added action request in S3 plugin.

* Added request data in Dynamo plugin

* Added request in Elastic Search.

* Request in Firestore.

* Request added in Mongo

* MsSQL request added.

* Added MySQL request.

* Added Postgres request.

* Added redis request.

* Redshift doen.

* Catching AppsmithPluginExceptions at the plugin level itself to ensure that the request gets passed on as part of the result.

* Fixed failing plugin test failures

* Fixed AmazonS3 test failures.

* WIP post analytics working

* WIP : Making the request data confirm to existing analytics request data format.

* Fixed the headers in the analytics body.

* Migrations S3, Postgres to the accepted format for request in analytics

* Updated S3 action to be the query

* Migration completed for all plugins for analytics.

* Removed the old analytics event. Now sending only the new one.

* Ensuring all data is captured in S3 plugin request in case of error.

* Minor editing of firestore to ensure that the errors get caught by the plugin itself.

* Fixed test cases in Amazon S3

* Incorporated review comments.
2021-03-02 10:58:46 +05:30
Shrikant Sharat Kandula
dc146a1a16
Fix MongoDB test operation errors not being caught (#3234) 2021-02-26 12:55:54 +05:30
Shrikant Sharat Kandula
72df6fb299
Allow MongoDB datasources without username/password (#3149) 2021-02-23 16:54:27 +05:30
Shrikant Sharat Kandula
e2509ae325
Add placeholder for MongoDB datasource config's host inputs (#3145)
* Remove example indicator
2021-02-23 09:52:45 +05:30
Arpit Mohan
a973d779fd
Correcting the display message for query actions based on isExecutionSuccess flag (#3045)
Also improving the mongo error response string. Now we only send the error message instead of the entire stack trace back to the client
2021-02-15 22:10:04 +05:30
Sumit Kumar
e6b77a1299
Stop logging some AppsmithPluginException to Sentry (#2351)
1. Move package  appsmith-interfaces/src/main/java/com/appsmith/external/pluginExceptions-> appsmith-interfaces/src/main/java/com/appsmith/external/exceptions/pluginExceptions
2. Move enum AppsmithErrorAction from appsmith-server/src/main/java/com/appsmith/server/exceptions/AppsmithError.java -> appsmith-interfaces/src/main/java/com/appsmith/external/exceptions/AppsmithErrorAction.java, so that both plugin exceptions and server exceptions could use the same enum.
3. Log exception based on the error action defined for each exception.
2021-02-04 15:24:30 +05:30
Shrikant Sharat Kandula
42efb20d14
Remove unused cert fields for Mongo and Postgres plugins (#2723) 2021-01-26 18:44:01 +05:30
Sumit Kumar
6299c86f39
Add TC to test mongodb connection establishment (#2364)
1. Test that when a query is attempted to run on mongodb server but refused because of lack of authorization, then
also, it indicates a successful connection establishment.
2020-12-28 11:58:17 +05:30
Shrikant Sharat Kandula
5e04ca5c9d
Add ability to configure order of templates of plugins (#2279) 2020-12-18 20:45:08 +05:30
Nidhi
a00c144e85
Subclassing authentication (#2215)
* Sublcassing authentication

* Removed TODO

* Review changes
2020-12-17 21:38:52 +05:30
Trisha Anand
8283396056
Moved from boundedElastic to elastic to ensure that the server services the plugin execution request as soon as the request arrives. (#2090) 2020-12-08 22:04:14 +05:30
Trisha Anand
2062c60ca3
Moved all the scheduling of the plugin executions to bounded elastic instead of elastic. (#1931) 2020-11-26 17:50:43 +05:30