uptrace / bun

SQL-first Golang ORM
https://bun.uptrace.dev
BSD 2-Clause "Simplified" License
3.84k stars 231 forks source link

MariaDB: add support for RETURNING clause in DELETE statements #1059

Closed capcom6 closed 1 week ago

capcom6 commented 2 weeks ago

This PR adds support for RETURNING clauses in DELETE statements specifically for MariaDB databases. MariaDB has supported the RETURNING clause in DELETE statements since version 10.0.5.

Changes:

Example usage:

db.NewDelete().Model(new(Model)).WherePK().Returning("*")

Notes:

Discussion:

References: