moved all SQL queries into single Database module

Any chance you want to do or find a performance test of SQLAlchemy for
simple selections?

On Fri, Dec 12, 2014 at 4:24 PM, Tavi Nathanson <notifications@github.com>
wrote:
>
> In pyensembl/transcript.py
> <https://github.com/hammerlab/pyensembl/pull/16#discussion-diff-21774329>:
>
> > @@ -104,18 +109,12 @@ def _transcript_feature_ranges(self, feature, required=True):
> >          if feature not in self._TRANSCRIPT_FEATURES:
> >              raise ValueError("Invalid transcript feature: %s" % feature)
> >
> > -        query = """
> > -            SELECT DISTINCT start, end
> > -            FROM ensembl
> > -            WHERE feature = ?
> > -            AND transcript_id = ?
> > -        """
> > -        query_params = [
> > -            feature,
> > -            self.id
> > -        ]
> > -        cursor = self.db.execute(query, query_params)
> > -        results = cursor.fetchall()
> > +        results = self.db.query(
>
> Feels SQLAlchemy'ish!
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/hammerlab/pyensembl/pull/16/files#r21774329>.
>