Last time, we wrote a function to check whether a given database schema is connected – ignoring relations for constants, as a special case – and wrote a property test to show that the schemas generated by normalise and autodb aren’t always connected. Our goal is to add virtual “pre-decomposition” relations to make the schema connected; I’m referring to them as “views”, which is a misnomer, but is much shorter to write.
Last time, I showed how I think that adding “views” – i.e. previous decomposition steps, or “pre-decompositions” – to a database schema might ensure that it stays connected. Now we need to work out how to implement it.
library(autodb) ## ## Attaching package: 'autodb' ## The following object is masked from 'package:stats': ## ## decompose show <- function(x) DiagrammeR::grViz(gv(x), width = "100%") Test property The problem we want to solve is that the database schema given by autodb sometimes isn’t connected, so the first thing we need is a function that checks whether a schema is connected.
autodb is still chugging along. Most of the additions I’ve made recently have been stuff that’s nice to have around the edges. Add a code generator for diagrams in D2. Improve the documentation a bit. Speed the existing algorithms up a bit. But there’s been no large addition since I added the FDHits search algorithm earlier in the year, which sped up the search by several orders of magnitude.