appsmithorg / appsmithorg/appsmith

[Bug]: Smart substitution and prepared statements need you to explicitly cast fields

Open
#8,784 7 comments 0 reactions 1 assignee Claimed by @leotom2000 View on GitHub
Backend Bug Integrations Product Low Needs Triaging Prepared statements Production Query & JS Pod Query Widgets & IDE Pod
Dominant language
TypeScript
Stars
40.9k
Forks
4.8k
Avg merge
1d 22h
Merged PRs (30d)
45

Description

### Is there an existing issue for this?

- [X] I have searched the existing issues

### Current Behavior

Users have reported that when working with data types in SQL, JSON and number are impossible to insert without an explicit cast.
Similarly in APIs if an input has a number, the value is always sent as a string.

### Steps To Reproduce

1. Drag an Input widget
2. Create a postgres query to insert the input value into a table column with integer type
3. Enter a value and run the query
4. The query fails unless we cast it to an integer as
```
Insert into table1 (col1) values ({{Input1.text}} :: Integer)
```
The same can be reproduced for an API

### Environment

Production

### Version

Cloud

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.