Skip to content

About

SQL domains and PostgreSQL operators for stricter types in databases

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 @)

About

SQL domains and PostgreSQL operators for stricter types in databases

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages