Implements DB API