~/talk

C++20 ❤ SQL

Talkat CppCon 2021 · on Wednesday, 2021-10-27· at 15:15· online· [databases]
links:none on file
slides:none on file

Claim: C++20 lets SQL queries be embedded as constexpr SQL strings and annotated with tiny C‑style comments to generate compile‑time parameter and row bindings. Implementation uses C++20 non‑type template params, a metastruct reflection helper and sqlite as the backend. Result is a small library — about ~500 lines plus metastruct ~250, under 1000 total — that prevents SQL injection, produces compile‑time errors for missing parameters or wrong types, and returns optionals for nullable columns, and it works.

AI-written summary · about

  1. 0:00Start
  2. 1:22Overview
  3. 3:08Example Database
  4. 3:35Create the customers table
  5. 6:24Avoiding SQL Injection Attacks
  6. 7:40Traditional Library with Strings
  7. 9:24Domain Specific Language
  8. 10:28Object Relational Model
  9. 16:23Lookup a customer by name
  10. 20:05Key Design Insight
  11. 21:06Annotations
  12. 22:41Implementation
  13. 27:18Parsing the type specs
  14. 28:26combined type specs and type specs
  15. 33:06Turn type specs into meta struct
  16. 37:43Binding SQL Parameters
~/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.