Skip to content
John James Jacoby edited this page May 27, 2026 · 1 revision

Traits

BerlinDB traits live in src/Database/Traits.

Most users do not use these directly. They are documented here so contributors can understand where behavior lives.

Base

Shared object helpers.

  • to_array()
  • apply_prefix()
  • first_letters()
  • set_vars()

Boot

Constructor and argument lifecycle.

Classes using this trait can customize:

  • sunrise()
  • parse_args()
  • special_args()
  • validate_args()
  • init()

Cast

Applies row casts after object properties are assigned.

Environment

Resolves the active database connection.

  • get_db_global()
  • db()
  • get_db()
  • is_testing()

Error

Contains success checking helpers.

Lifecycle

Manages temporary state during nested operations.

Log

Stores structured log entries in memory.

Useful methods:

  • get_logs()
  • clear_logs()

Magic

Provides magic property helpers.

  • __get()
  • __isset()

Operator

Shared behavior for SQL operator classes.

Parser

Shared behavior for query parsers, including query sanitization, operator lookup, SQL clause generation, date helpers, and caller delegation.

Sanitizer

Shared sanitization helpers for table names, aliases, column names, index names, comments, and SQL identifiers.

Clone this wiki locally