Database Namespace

The Database namespace provides classes used with DML operations.

The following are the classes in the Database namespace.

  • Batchable Interface

    The class that implements this interface can be executed as a batch Apex job.

  • BatchableContext Interface

    Represents the parameter type of a batch job method and contains the batch job ID. This interface is implemented internally by Apex.

  • Cursor Class

    Contains methods to fetch records and to get the number of cursor rows returned from a SOQL query.

  • CursorFetchResult Class

    This class encapsulates the result of a PaginationCursor.fetchPage() call. It contains methods that get the rows for the current page, the start index of the next page, and the number of deleted rows skipped during the fetch operation. It also contains a method that indicates whether the pagination cursor has fetched all available rows in the result set.

  • DeletedRecord Class

    Contains information about a deleted record.

  • DeleteResult Class

    Represents the result of a delete DML operation returned by the Database.delete method.

  • DMLOptions Class

    Enables you to set options related to DML operations.

  • DmlOptions.AssignmentRuleHeader Class

    Enables setting assignment rule options.

  • DMLOptions.DuplicateRuleHeader Class

    Determines options for using duplicate rules to detect duplicate records. Duplicate rules are part of the Duplicate Management feature.

  • DmlOptions.EmailHeader Class

    Enables setting email options.

  • DuplicateError Class

    Contains information about an error that occurred when an attempt was made to save a duplicate record. Use if your organization has set up duplicate rules, which are part of the Duplicate Management feature.

  • EmptyRecycleBinResult Class

    The result of the emptyRecycleBin DML operation returned by the Database.emptyRecycleBin method.

  • Error Class

    Represents information about an error that occurred during a DML operation when using a Database method.

  • GetDeletedResult Class

    Contains the deleted records retrieved for a specific sObject type and time window.

  • GetUpdatedResult Class

    Contains the result for the Database.getUpdated method call.

  • LeadConvert Class

    Contains information used for lead conversion.

  • LeadConvertResult Class

    The result of a lead conversion.

  • MergeResult Class

    Contains the result of a merge Database method operation.

  • PaginationCursor Class

    This class represents a pagination cursor that can traverse a SOQL query result set. It contains methods that fetch rows by page. It also contains a method that returns the total number of rows in the result set.

  • QueryLocator Class

    Represents the record set returned by Database.getQueryLocator and used with Batch Apex.

  • QueryLocatorIterator Class

    Represents an iterator over a query locator record set.

  • QueryOptions Class

    Contains an immutable configuration for the SOQL SET OPTIONS clause.

  • QueryOptionsBuilder Class

    Contains methods to build an immutable Database.QueryOptions instance.

  • SaveResult Class

    The result of an insert or update DML operation returned by a Database method.

  • UndeleteResult Class

    The result of an undelete DML operation returned by the Database.undelete method.

  • UpsertResult Class

    The result of an upsert DML operation returned by the Database.upsert method.