stephencelis / SQLite.swift

A type-safe, Swift-language layer over SQLite3.
MIT License
9.57k stars 1.54k forks source link

Add TableBuilder overloads for two and three element foreign key constraints with optional values #1174

Closed zaphoyd closed 9 months ago

zaphoyd commented 1 year ago

The TableBuilder supports foreign key constraints with optional values for single column foreign keys. It also supports overloads for 2 and 3 column keys with no optional values. We ended up needing a bunch of different combinations of 2 and 3 column foreign keys with optional values in various places for a project.

This PR includes those extra overloads as well as a documentation example for how to use the multi-column foreign key support already in TableBuilder (which we ended up having to reference the code to figure out how to use).

jberkel commented 1 year ago

@zaphoyd Thanks for the PR, can you please check the linting errors?