Extra Block Types (EBT) - New Layout Builder experience❗

Extra Block Types (EBT) - styled, customizable block types: Slideshows, Tabs, Cards, Accordions and many others. Built-in settings for background, DOM Box, javascript plugins. Experience the future of layout building today.

Demo EBT modules Download EBT modules

❗Extra Paragraph Types (EPT) - New Paragraphs experience

Extra Paragraph Types (EPT) - analogical paragraph based set of modules.

Demo EPT modules Download EPT modules

Scroll
13/04/2025, by Ivan

The Drupal 8 Database API provides a standardized, vendor-independent abstraction layer for accessing database servers. You should almost never make direct database calls unless you are developing core APIs.

The API is designed to preserve the syntax and power of SQL as much as possible, while also:

  • Making it easy to support multiple database servers;
  • Allowing developers to use more advanced features like transactions;
  • Providing a structured interface for dynamically building queries;
  • Ensuring security validation and other best practices;
  • Giving modules a clean interface to intercept and alter site queries.

 

The core Database API documentation is derived directly from code comments. This section of the handbook complements those API docs by offering a tutorial for module authors who want to interact with the database system, as well as an overview from an administrator's perspective.

The Database API was built using object-oriented design concepts, and therefore this document assumes at least some familiarity with those concepts. Common operations also have procedural style alternatives available, but these procedural styles are not recommended. The preferred way to interact with the database is through the connection object.

Note that the Database API may not always be the best option for data interaction. Using an API in Drupal 8 is usually situational—for example, using the Node API for node CRUD operations, the Entity API for creating entities, etc. Please consult the API documentation to determine which API best fits your needs.

Note: This handbook may not cover all features of the API.

Drupal’s online documentation is © 2000-2020 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License.