Skip to content

Latest commit

 

History

History
50 lines (35 loc) · 1.67 KB

README.md

File metadata and controls

50 lines (35 loc) · 1.67 KB

If you like Python data type hints, you might like SQL domains

Source code to accompany my October 30, 2026 article ( LinkedIn | blog ) about stricter types in databases (SQL domain and PostgreSQL operators)

SQL formatting

SQL formatting conventions

Current or potential comma-separated lists

  • Examples: select : from , group by , order by
  • 1 item per line; indent 1 extra space for comma
  • Conspicuous leading comma prevents syntax errors when items are added

Boolean expressions

  • Examples: select : where , having
  • No extra indentation unless and until logical operators (not, or, and) are added
  • Then, use line breaks, indentation, and parentheses so that the expression can be read naturally and parallel parts of the expression can easily be recognized

Operators and keywords

  • Always align or space out pairs based on longer item

      =  >    asc   true
     !=  >=  desc  false

Licenses

Scope Link Included Copy
Source code, and source code in documentation GNU General Public License (GPL) 3.0 LICENSE-CODE.md
Documentation, including this ReadMe file GNU Free Documentation License (FDL) 1.3 LICENSE-DOC.md

Copyright Paul Marcelin

Contact: marcelin at cmu.edu (replace "at" with @)