Skip to main content

Module infer

Module infer 

Source
Expand description

Type inference, name validation, and default columns.

Upstream: getType and getObjectType (SchemaController.js:1555-1640), plus classNameIsValid and fieldNameIsValid (:446-480).

Inference is what makes Parse’s schema implicit: the first write that mentions a field decides its type forever. Everything downstream, including the error a client sees on the second write, follows from getting this exactly right.

Constants§

DEFAULT_COLUMNS
The four columns every class has (defaultColumns._Default).
SYSTEM_CLASSES
Classes Parse defines itself.
USER_COLUMNS
The additional default columns of _User (defaultColumns._User).

Functions§

class_name_is_valid
Is this a class a client may address?
field_name_is_valid
Field names a client may not use at all.
field_name_is_valid_for_class
Additionally refuses the default columns, which a client cannot redefine.
infer_type
Infer a field type from a value, as getType does.
schema_mismatch
The INCORRECT_TYPE a client sees when a write disagrees with the stored type.