{"id":398,"date":"2009-04-09T18:00:37","date_gmt":"2009-04-09T17:00:37","guid":{"rendered":"http:\/\/www.malcolmhardie.com\/weblogs\/angus\/?p=398"},"modified":"2025-02-01T03:04:15","modified_gmt":"2025-02-01T03:04:15","slug":"sqleditor-compound-foreign-keys","status":"publish","type":"post","link":"https:\/\/www.malcolmhardie.com\/weblogs\/angus\/2009\/04\/09\/sqleditor-compound-foreign-keys\/","title":{"rendered":"SQLEditor: Compound Foreign Keys"},"content":{"rendered":"<p>The newest version of SQLEditor (1.4.4b1) now has support for compound foreign keys. This is something that people have been asking about for a while now, so I&#8217;m pleased that it got included.<\/p>\n<p>There are some things that may need to be improved, but I&#8217;m fairly happy with the first revision of this.<\/p>\n<figure id=\"attachment_400\" aria-describedby=\"caption-attachment-400\" style=\"width: 443px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-400\" title=\"SQLEditor compound foreign key\" src=\"https:\/\/oak.malcolmhardie.com\/weblogs\/angus\/wp-content\/uploads\/2009\/04\/picture-1.png\" alt=\"Diagram showing compound foreign key\" width=\"443\" height=\"339\" \/><figcaption id=\"caption-attachment-400\" class=\"wp-caption-text\">Diagram showing compound foreign key<\/figcaption><\/figure>\n<p>The compound foreign key object is a new table level object that you can add from the Object menu just like a field or index. Then you drag from the foreign key to the target table. Finally you use the inspector to create pairs of columns to link together.<\/p>\n<p>When importing from a database SQLEditor will try to create field-to-field links on foreign keys with only 1 pair of columns unless you tell it otherwise. (There is a new preference to do this)<\/p>\n<p>Support is fairly complete, SQL parsing, database import, database export and SQL export are all available so it should work fairly well. I think the only thing it doesn&#8217;t do is auto-create indexes, so you may need to do this by hand on referenced columns (for those databases that need this)<\/p>\n<p>There is naturally a new inspector palette to go with the table object.<\/p>\n<figure id=\"attachment_401\" aria-describedby=\"caption-attachment-401\" style=\"width: 167px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-401\" title=\"Compound foreign key inspector\" src=\"http:\/\/www.malcolmhardie.com\/weblogs\/angus\/wp-content\/uploads\/2009\/04\/picture-2-167x300.png\" alt=\"Compound foreign key inspector\" width=\"167\" height=\"300\" \/><figcaption id=\"caption-attachment-401\" class=\"wp-caption-text\">Compound foreign key inspector<\/figcaption><\/figure>\n<p>This allows you to add pairs of columns using the + button at the bottom. Choose your columns using the little popup menus.<\/p>\n<p>The whole thing is completely new, so please send in your thoughts to the usual address.<\/p>\n<p><a href=\"http:\/\/www.malcolmhardie.com\/sqleditor\/releases\/1.4.4b1\/SQLEditor-1-4-4b1.dmg\">Download SQLEditor 1.4.4b1<\/a><\/p>\n<p>(or enable the &#8220;Check for beta versions&#8221; preference and then use the check for updates feature)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The newest version of SQLEditor (1.4.4b1) now has support for compound foreign keys. This is something that people have been asking about for a while now, so I&#8217;m pleased that it got included. There are some things that may need to be improved, but I&#8217;m fairly happy with the first revision of this. The compound [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[46,49,64,65],"class_list":["post-398","post","type-post","status-publish","format-standard","hentry","category-sqleditor","tag-mac","tag-malcolmhardie-solutions","tag-sql","tag-sqleditor"],"_links":{"self":[{"href":"https:\/\/www.malcolmhardie.com\/weblogs\/angus\/wp-json\/wp\/v2\/posts\/398","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.malcolmhardie.com\/weblogs\/angus\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.malcolmhardie.com\/weblogs\/angus\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.malcolmhardie.com\/weblogs\/angus\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.malcolmhardie.com\/weblogs\/angus\/wp-json\/wp\/v2\/comments?post=398"}],"version-history":[{"count":1,"href":"https:\/\/www.malcolmhardie.com\/weblogs\/angus\/wp-json\/wp\/v2\/posts\/398\/revisions"}],"predecessor-version":[{"id":1396,"href":"https:\/\/www.malcolmhardie.com\/weblogs\/angus\/wp-json\/wp\/v2\/posts\/398\/revisions\/1396"}],"wp:attachment":[{"href":"https:\/\/www.malcolmhardie.com\/weblogs\/angus\/wp-json\/wp\/v2\/media?parent=398"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.malcolmhardie.com\/weblogs\/angus\/wp-json\/wp\/v2\/categories?post=398"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.malcolmhardie.com\/weblogs\/angus\/wp-json\/wp\/v2\/tags?post=398"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}