~/talk

RETURNING clause: have your cake and eat it too

Talkat FOSDEM 2021 · on Sunday, 2021-02-07· at 14:20· L.lightningtalks· [databases]

MariaDB adds a RETURNING clause that returns inserted, replaced or deleted rows so you avoid a separate SELECT: INSERT ... RETURNING and REPLACE ... RETURNING arrive in Server 10.5 while DELETE ... RETURNING is available since 10.0. RETURNING can output columns, virtual columns, aliases, expressions (bitwise, arithmetic, logical), functions, subqueries and prepared statements. Examples show using auto_increment and defaults to get generated customer_id, using INSERT IGNORE or ON DUPLICATE KEY UPDATE to see what changed, and DELETE ... RETURNING to move customers with credit_score < 700 into another table.

AI-written summary · about

  1. 0:00Introduction
  2. 0:10What is returning
  3. 0:37Expressions
  4. 1:07Why do we need it
  5. 2:13How to use it
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.