Commit Graph

99 Commits

Author SHA1 Message Date
subratadeypappu
eaf9b95bd6
fix: Internal server error in case of ARRAY type in MySQL (#17702) (#17838)
Fix internal server error in case of ARRAY type in MySQL (#17702)

This commit adds support for handling array like data in MySQL
- If the data type identified by the client side is of type ARRAY it will be treated as STRING as MySQL doesn't have support for ARRAY data type
2022-10-28 11:51:59 +05:30
subratadeypappu
19e2e5785e
Fix/16994 refactor common datatype handling (#17429)
* fix:Add array datatype to execute request

* feat: Consume and store type of array elements in Param class (#16994)

* Append param instead of clientDataType in varargs (#16994)

* Refactor common data type handling w.r.t newer structure (#16994)

This commit takes care of the following items:
- It minimizes the number of usage to the older stringToKnownDataTypeConverter method
- Modifies the existing test cases to conform to the newer structure
- Marks stringToKnownDataTypeConverter method as deprecated to discourage further use

* Remove comma delimited numbers from valid test cases (#16994)

* Fix extracting clientDataType from varargs in MySQL (#16994)

* Pass param as a dedicated parameter in json smart replacement (#16994)

* Remove varargs from json smart replacement method (#16994)

* Move BsonType to mongoplugin module (#16994)

* Introduce NullArrayType and refactor BsonType test cases (#16994)

* Add new test cases on numeric string with leading zero (#16994)

* Refactor test case name (#16994)

* Add comment on the ordering of Json and Bson types (#16994)

* Add comment on the ordering of Json and Bson types (#16994)

* Add NullArrayType in Postgres and introduce postgres-specific types (#16994)

* Add data type test cases for Postgres and change as per review comments (#16994)

Co-authored-by: ChandanBalajiBP <chandan@appsmith.com>
2022-10-18 11:02:37 +05:30
Nidhi
c3e935ef40
fix: Remove datasource connection from cache when datasource is deleted (#17364)
* Changes to testDatasource interface method and archive flow

* Tests for plugin level testDatasource implementations

* Added test for refreshing cache on deleting datasource

* Modified warnings to errors in logs

* Fixed test

* Fixed test
2022-10-17 10:31:26 +05:30
Aman Agarwal
78c89894f8
fix: updated settings page design (#16990)
fix: updated settings page design
2022-10-06 16:36:29 +05:30
subratadeypappu
d2de8f7cec
feat: Implement data type handling in MySQL (#16621) (#17017)
* feat: Implement data type handling in MySQL (#16621)

With this implementation we can now achieve the following under prepared statement:
- Ability to distinguish between null object and "null" string
- Ability to distinguish values like {{"098765"}} and {{098765}}. The former is identified as a string and the latter is identified as an integer

* feat: Add unit test cases on data type handling in MySQL (#16621)

* chore: Move MySQL specific types to a separate class (#16621)

* chore: Remove import shortening (#16621)

* Fix testStructure test case to have loose coupling with the order of tables (#16621)

* Fix: Add missing client-side data types in params in a few test cases (#16621)

* Fix query in test case (#16621)

* Fix test cases and add small refactoring (#16621)

* Refactor assertion with a check on Optional (#16621)

* additional cypress test cases for mysql

* updated test case object

* update for failing test cases

* mysql failure point fix

* mysql false spec failure point fix

* fix flacy test cases

* flacky JSON test cases

Co-authored-by: ChandanBalajiBP <chandan@appsmith.com>
Co-authored-by: Aishwarya UR <aishwarya@appsmith.com>
2022-10-04 10:45:10 +00:00
Nidhi
66f3dfe790
chore: Move to Jupiter JUnit5 (#17083)
* Upgrading to Jupiter tests for everything but plugins

* Whoops, too soon

* Fixed failing tests

* Imports fixed

* Removed PowerMock dep and JUnit4 from interfaces

* Woohoo! That's testcontainers

* Added maven enforcer to disallow junit4

* Update app/server/appsmith-server/src/test/java/com/appsmith/server/services/GitServiceTest.java

Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com>

* Update app/server/appsmith-server/src/test/java/com/appsmith/server/services/UserWorkspaceServiceTest.java

Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com>

* Update app/server/appsmith-server/src/test/java/com/appsmith/server/services/ce/ActionServiceCE_Test.java

Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com>

* Update app/server/appsmith-server/src/test/java/com/appsmith/server/solutions/CreateDBTablePageSolutionTests.java

Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com>

* Weird formatting and version upgrades

Co-authored-by: Shrikant Sharat Kandula <shrikant@appsmith.com>
2022-09-29 08:54:07 +05:30
subratadeypappu
cf2ef37527
feat: Add a service layer to get AppsmithType from client-type (#16508) (#16619)
* feat: Add a service layer to get AppsmithType from client-type (#16508)

This commit takes care of the following things
- It creates a service layer to get the target AppsmithType from the client-side data type and the evaluated value
- This service layer is currently not consumed by any plugins
- A full JUnit test suit for MySQL-specific types

* feat: Remove FloatType and add comments for better understanding (#16508)

* feat: Add FallbackType and covert the DataTypeService to a util class (#16508)

This commit takes care of these
- Introduce FallbackType as a separate type
- Convert the DataTypeService to a util class
- Add java doc around the methods in DataTypeService class

* feat: Rename DataTypeService to DataTypeServiceUtils (#16508)
2022-09-16 17:40:28 +06:00
Shrikant Sharat Kandula
06c8210a3a
fix: Fix LinkageError with macOS DNSResolver class (#16581)
On macOS, when running a MySQL query, we see the following error:

```
java.lang.ClassCastException: class io.netty.channel.kqueue.KQueueEventLoopGroup cannot be cast to class io.netty.channel.EventLoopGroup
```

This is because of a `LinkageError`, caused because these classes exist both in the parent `server` module classpath, as well as in this plugin's classpath separately. To fix this, we removed this dependency from the server module.

But then, this caused a problem with how the `DNSResolver` class was being, well, resolved by the application class loader, vs the plugin class loader. This is a macOS specific problem, and doesn't affect other operating systems.

For this, we add just this package as a dependency to the MySQL plugin.
2022-09-06 22:00:53 +05:30
subratadeypappu
3725834fb4
feat: Add server-side base data types (#15784) (#16240)
* feat: Add server-side base data types (#15784)

This commit takes care of the following two things
- It adds the server-side base data types which are considered common data types across plugins
- It adds a few MySQL specific types

* feat: Add MySQLBooleanType and refactor MySQLDateTimeType with camelCase (#15784)

* feat: Move MySQL specific types to mysqlPlugin folder (#15784)
2022-09-02 16:25:36 +05:30
Shrikant Sharat Kandula
8a0838505a
All outgoing requests should go through the configured proxy (#14427)
Signed-off-by: Shrikant Sharat Kandula <shrikant@appsmith.com>
Co-authored-by: Aishwarya UR <aishwarya@appsmith.com>
2022-09-01 11:16:45 +05:30
Nidhi
6df4dafead
chore: Better server logging infra (#15440)
* Fixed a bunch of server side logging issues

* Tests

* Added ISO8601 timestamp to log format
2022-07-28 09:40:03 +05:30
Shrikant Sharat Kandula
bba78afc3b
chore: Upgrade dependencies reported by Dependabot (#13735)
Upgrades vulnerable dependencies in all plugins except for MySQL. That one is still failing and I'll fix it in a separate PR. Issue #14475

Co-authored-by: Nayan <nayan@appsmith.com>
Co-authored-by: Anagh Hegde <anagh@appsmith.com>
2022-07-19 10:23:27 +05:30
dependabot[bot]
5e0677bc5d
chore: bump mysql-connector-java from 8.0.20 to 8.0.28 in /app/server/appsmith-plugins/mysqlPlugin (#14696)
chore(deps-dev): bump mysql-connector-java

Bumps [mysql-connector-java](https://github.com/mysql/mysql-connector-j) from 8.0.20 to 8.0.28.
- [Release notes](https://github.com/mysql/mysql-connector-j/releases)
- [Changelog](https://github.com/mysql/mysql-connector-j/blob/release/8.0/CHANGES)
- [Commits](https://github.com/mysql/mysql-connector-j/compare/8.0.20...8.0.28)

---
updated-dependencies:
- dependency-name: mysql:mysql-connector-java
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-01 00:41:23 +05:30
subratadeypappu
04f11d5910 Merge branch 'release' into fix/14054-describe-table-in-mysql 2022-06-17 11:25:58 +06:00
sidhantgoel
7fc5dc059a
Merge pull request #13999 from appsmithorg/fix/mysql_testfix
fixed mysql plugin tests
2022-06-04 17:10:20 +05:30
Sumit Kumar
910875ddfc
fix: fix class cast exception seen on MySQL plugin when built on local setup (#14099)
* fix class cast exception by removing all netty.io packages from mysql r2dbc
* fix CI test failure
2022-06-02 17:14:21 +05:30
subratadeypappu
c52ce5200d fix: Show table structure when desc table or describe table command is run stand-alone in MySQL (#14054) 2022-06-01 19:23:42 +06:00
Sidhant Goel
7e24ae2126
fixed mysql plugin tests 2022-05-21 16:47:42 +05:30
Mojtaba Zarezadeh
d1ddebd3d8 merge all tests in one file 2022-02-01 13:02:53 +03:30
Mojtaba Zarezadeh
8197ebf297 fix: add single imports 2022-02-01 10:32:55 +03:30
Mojtaba Zarezadeh
e400ea0e80 cleanup: improve comments 2022-01-28 13:03:07 +03:30
Mojtaba Zarezadeh
6d3be8c283 fix(mysqlPlugin): allow empty password if user is not empty 2022-01-28 11:43:21 +03:30
Arpit Mohan
96677ef673
fix: Updating log4j to 2.17.0 to prevent JNDI lookups (#9863)
Also making minor edit to not show "Application name updated" toast message. This is a counter-productive toast that is distracting the user
2021-12-20 16:01:08 +05:30
Trisha Anand
57ed477510
fix: Adding Prepared Statement setting to the main query pane for Postgres, MySQL and MS SQL plugins (#7762) 2021-09-23 14:39:22 +00:00
Sumit Kumar
146f536190
fix: fix mysql prepared statement integer and boolean type handling (#6987)
* fix mysql prepared statement integer and boolean type handling
2021-09-17 08:56:12 +00:00
Arpit Mohan
37e7a61792
chore: Minor changes for fixing some strings on the home page & action settings page (#7469) 2021-09-15 12:20:25 +00:00
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
Nidhi
8be0580c77
Fixed template queries for PG, MySQL and Snowflake (#6698)
* Fixed template queries

* Fixed tests
2021-08-19 16:35:32 +05:30
Sumit Kumar
8f9963515b
Fix: Mysql plugin: add timeout to validation check to avoid connection block. (#6555)
* add timeout to validation check to avoid connection block.
2021-08-12 17:32:29 +05:30
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
Nidhi
4f42c29f95
Ignore comments while preparing executable statement in MySQL plugin (#5838)
* Ignore comments while preparing executable statement in MySQL plugin

* Added tests
2021-07-14 11:36:10 +05:30
Nikhil Nandagopal
e8ba1bee7f
removed quotes from sql templates because of prepared statements being on (#5404)
removed comments from sql templates confusing users with errors because of linting
2021-06-25 14:39:39 +05:30
Nidhi
57adbd7777
Schema info in templates query (#5244) 2021-06-18 11:31:17 +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
Anagh Hegde
b73f5c8ed1 Replace the repoTag from latest to fixed version 2021-06-04 12:37:16 +05:30
Anagh Hegde
b7ccb1da01 Fix - tests don't run on an M1 Silicon Mac 2021-06-04 11:15:44 +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
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
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
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
7dbae1e481
fix regex for whitespace (#3761)
- fix regex for whitespace
2021-03-30 15:03:39 +05:30