# HG changeset patch # User Nicolas Chauvat # Date 1552431695 -3600 # Node ID d5bbf030f96792e8102a6c0f5743b5cb770227e0 # Parent 3ddd03309315c9e9dd7cf4f48d73acc3fff1605b [server/sources/native] refactor to remove useless injection diff -r 3ddd03309315 -r d5bbf030f967 cubicweb/server/sources/native.py --- a/cubicweb/server/sources/native.py Wed Mar 13 00:15:48 2019 +0100 +++ b/cubicweb/server/sources/native.py Wed Mar 13 00:01:35 2019 +0100 @@ -51,8 +51,7 @@ from cubicweb.server.rqlannotation import set_qdata from cubicweb.server.hook import CleanupDeletedEidsCacheOp from cubicweb.server.edition import EditedEntity -from cubicweb.server.sources import AbstractSource, dbg_st_search, dbg_results -from cubicweb.server.sources.rql2sql import SQLGenerator +from cubicweb.server.sources import AbstractSource, dbg_st_search, dbg_results, rql2sql from cubicweb.misc.source_highlight import highlight_terminal from cubicweb.statsd_logger import statsd_timeit @@ -260,7 +259,7 @@ class NativeSQLSource(SQLAdapterMixIn, AbstractSource): """adapter for source using the native cubicweb schema (see below) """ - sqlgen_class = SQLGenerator + options = ( ('db-driver', {'type': 'string', @@ -333,8 +332,8 @@ self.authentifiers.insert(0, EmailPasswordAuthentifier(self)) AbstractSource.__init__(self, repo, source_config, *args, **kwargs) # sql generator - self._rql_sqlgen = self.sqlgen_class(self.schema, self.dbhelper, - ATTR_MAP.copy()) + self._rql_sqlgen = rql2sql.SQLGenerator(self.schema, self.dbhelper, + ATTR_MAP.copy()) # full text index helper self.do_fti = not repo.config['delay-full-text-indexation'] # sql queries cache