Function: Bootstrapped Queries

NOTE

This behavior will significantly change in version 0.3.

Purpose

The Query Builder in Wonderful Relations relies on specific queries to function properly. Since we use a bootstrapping approach, some queries need to be predefined because, without them, query construction would not be possible.

How It Works

Bootstrapped queries are stored in the table wp_wr_bootstrapped_query.

By convention, bootstrapped query identifiers start with: wr_qb_query_*

When the Executor encounters a query identifier with this prefix, it attempts to load the corresponding query from the wp_wr_bootstrapped_query table instead of the standard query table.

Managing Bootstrapped Queries

Bootstrapped queries are still configurable within Wonderful Relations, meaning they can be viewed and managed through the Query Service like any other query.

Advantages This concept ensures that as few queries as possible are hardcoded in PHP, leading to: • Optimization Possibilities – Reducing redundant query generation. • Better Organization – Keeping queries structured and accessible. • Reusability – Bootstrapped queries can be referenced dynamically. • Caching Benefits – Frequently used queries are loaded efficiently.

This approach helps maintain a cleaner and more modular system while ensuring the Query Builder functions correctly from the start. 🚀