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). - INVALID_
COLUMNS - Field names no class may use (
invalidColumns,SchemaController.js:163). - SYSTEM_
CLASSES - Classes Parse defines itself (
systemClasses,SchemaController.js:165-176). - USER_
COLUMNS - The additional default columns of
_User(defaultColumns._User). - VOLATILE_
CLASSES - Classes held in memory rather than loaded from
_SCHEMA(volatileClasses,SchemaController.js:178-187).
Functions§
- class_
name_ is_ valid - Is this a class a client may address?
- default_
columns_ for - The additional default columns of one class, or empty for a class that has none.
- 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_
op_ type - Infer a field type from an operation, as
getObjectType’s__oparm does (SchemaController.js:1634-1655). - infer_
type - Infer a field type from a value, as
getTypedoes. - invalid_
class_ name_ message invalidClassNameMessage(SchemaController.js:483-489).- is_
default_ column - Is this field a default column of this class, counting both
_Defaultand the class’s own? - required_
read_ columns - Columns that must be present for a read of a class (
requiredColumns.read,SchemaController.js:154-156). - required_
write_ columns - Columns that must be present for a write to a class to be accepted
(
requiredColumns.write,SchemaController.js:157-160). - schema_
mismatch - The
INCORRECT_TYPEa client sees when a write disagrees with the stored type.