What is the schema, the namespace and the Schema namespace

Can anyone help me understand what is the Schema, the namespace and consequently the Schema namespace ?

asked Nov 3, 2018 at 8:25 81 1 1 silver badge 7 7 bronze badges

can you provide some examples of where you're seeing these terms? as they can be interpreted differently depending on context it helps alot to have your context

Commented Nov 3, 2018 at 9:39

2 Answers 2

"Schema", generically, refers to the structure of the database. In Salesforce terms, that means the set of objects you have, the fields on those objects, and the relationships between them. You'll see this usage, for example, in the Schema Builder tool in Setup.

Apex provides a Schema class, which includes top-level methods to get Describe API information about the schema (and associated metadata, like available tabs). The Schema class is in the System namespace.

Apex also has a Schema namespace. The Schema namespace hosts a variety of classes that are used by the Describe API, like DescribeFieldResult . It's also the namespace for static references into Describe metadata, like Schema.sObjectType.Account .