[PP-2] Enable dynamic queries to produce SQL with positional placeholders

Created on 3 November 2023, over 1 year ago

Problem/Motivation

Drupal's dynamic queries produce SQL with named placeholders. In 📌 Create the database driver for MySQLi for async queries Active , since mysqli is NOT supporting named placeholders, we are introducing an helper class that converts an SQL with named placeholders to one with positional ones.

This is inefficient, since it has to deconstruct a ready SQL statement and rebuild it.

Proposed resolution

Introduce logic that enables dynamic queries to produce SQL with either named or positional placeholders, and prevent mysqli driver to run through the converter if a statement is already built with positional parameters.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

📌 Task
Status

Postponed

Version

11.0 🔥

Component
Database 

Last updated 1 day ago

  • Maintained by
  • 🇳🇱Netherlands @daffie
Created by

🇮🇹Italy mondrake 🇮🇹

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @mondrake
  • Pipeline finished with Success
    over 1 year ago
    Total: 1039s
    #44104
  • Pipeline finished with Failed
    about 1 month ago
    Total: 187s
    #464815
  • Pipeline finished with Failed
    about 1 month ago
    Total: 648s
    #464817
  • Pipeline finished with Failed
    about 1 month ago
    Total: 230s
    #465442
  • 🇮🇹Italy mondrake 🇮🇹

    Merged MR with 📌 Create the database driver for MySQLi for async queries Active to allow progressing.

  • Pipeline finished with Failed
    about 1 month ago
    Total: 160s
    #465498
  • Pipeline finished with Success
    about 1 month ago
    Total: 990s
    #465504
  • Pipeline finished with Failed
    about 1 month ago
    Total: 141s
    #465754
  • Pipeline finished with Failed
    about 1 month ago
    Total: 144s
    #465760
  • Pipeline finished with Success
    about 1 month ago
    Total: 1666s
    #465763
  • 🇮🇹Italy mondrake 🇮🇹

    While it's relatively straightforward to do this for plain INSERTs, this get complicated for all other operations where conditions get into the equation. The problem is that named placeholders are allowed in the expressions' string: while we could easily parse the strings to replace them with positional ones, that would defy the purpose of this issue that is to natively build SQL with positional placeholders, without need of reprocessing.

    I start thinking we need something along the lines of 📌 [WIP] Decouple identifier management from database Connection, introduce an IdentifierHandler class Postponed , but for placeholders. So to have placeholders as value objects and not strings and therefore being able to build SQL taking that into account.

  • Pipeline finished with Failed
    about 1 month ago
    Total: 227s
    #466290
Production build 0.71.5 2024