~/talk

Building a Type-Safe SQL Template Engine

TalkinJapaneseat PHP Conference Japan 2023 · on Sunday, 2023-10-08· [php]
links:none on file
slides:none on file

A tiny PHP library implements a type-safe SQL template engine that relies on PDO::quote-only escaping, supports typed placeholders like @in@string and @int, and can expand variable-length IN lists and paging. It compiles, binds, and executes queries in a single call using a processor pipeline and a preg-replace callback replacer to perform all replacements in one pass, and intentionally avoids full SQL parsing or DB-specific identifier quoting, so it’s suitable for simple templating but needs additional adapters, documentation, and tests for wider use.

AI-written summary · about

  1. 0:00Introduction
  2. 1:49SQL injection risks
  3. 6:50SQL template engines
  4. 9:17PDO limitations
  5. 12:46Implementation details
  6. 14:12Redesigning for support
  7. 16:42Query processor interface
  8. 19:09Placeholder types
  9. 20:38Live demo
  10. 25:08Q&A
~/search
type to search 8,222 conferences, 162,397 speakers and 219,688 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
← →
on a talk: 5 seconds back / forward
0–9
on a talk: jump to 0%–90% of the recording
?
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.