feat: Add support for Decimal128 data type by YazanAlkhalil · Pull Request #10083 · parse-community/parse-server
Adds Decimal128 support using `{ __type: 'Decimal128', value: '<string>' }` REST format, enabling high-precision decimal numbers for monetary values, blockchain amounts, and other use cases that exceed the precision of the Number (double) type.
Changes:
- Schema: Register Decimal128 as a valid field type
- MongoDB: Store as native Decimal128, with full coder for JSON/DB conversion
- PostgreSQL: Map to `numeric` type for equivalent precision
- GraphQL: Add Decimal128 scalar type and Decimal128WhereInput filter
- Tests: 10 tests covering CRUD, comparison queries, and edge cases
Closes parse-community#8840
bot requested changes Feb 28, 2026
Adds tests for DECIMAL128 parseValue, serialize, and parseLiteral methods to improve code coverage on the new Decimal128 type.
@yazan.alkhalil added 3 commits
February 28, 2026 22:52- Tighten Decimal128 validation to require string values in SchemaController - Add string type check in MongoTransform Decimal128Coder isValidJSON/JSONToDatabase - Handle Decimal128 in Postgres $in/$nin by using toPostgresValue() - Add Kind.OBJECT support in GraphQL DECIMAL128 parseLiteral - Strengthen high-precision test to assert exact round-trip equality
Cover constraintType, inputType, and outputType transformer functions to improve patch coverage above the 92% threshold.
- Fix Decimal128 round-trip for values nested inside Object fields by handling deserialized BSON Decimal128 objects in isValidDatabaseObject and databaseToJSON - Use Decimal128Coder.isValidDatabaseObject() instead of raw instanceof in nestedMongoObjectToNestedParseObject and mongoObjectToParseObject - Add tests for nested Decimal128 and invalid value rejection
Prevents numeric AST literals (Kind.INT, Kind.FLOAT) from being accepted in the inline object syntax, matching parseValue behavior.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters