147 def __init__(self, repo, appschema, source_config, *args, **kwargs): |
147 def __init__(self, repo, appschema, source_config, *args, **kwargs): |
148 SQLAdapterMixIn.__init__(self, source_config) |
148 SQLAdapterMixIn.__init__(self, source_config) |
149 self.authentifiers = [LoginPasswordAuthentifier(self)] |
149 self.authentifiers = [LoginPasswordAuthentifier(self)] |
150 AbstractSource.__init__(self, repo, appschema, source_config, |
150 AbstractSource.__init__(self, repo, appschema, source_config, |
151 *args, **kwargs) |
151 *args, **kwargs) |
152 # sql generator |
|
153 self._rql_sqlgen = self.sqlgen_class(appschema, self.dbhelper, |
|
154 self.encoding, ATTR_MAP.copy()) |
|
155 # full text index helper |
152 # full text index helper |
156 self.do_fti = not repo.config['delay-full-text-indexation'] |
153 self.do_fti = not repo.config['delay-full-text-indexation'] |
157 if self.do_fti: |
154 if self.do_fti: |
158 self.indexer = get_indexer(self.dbdriver, self.encoding) |
155 self.indexer = get_indexer(self.dbdriver, self.encoding) |
159 # XXX should go away with logilab.db |
156 # XXX should go away with logilab.db |
160 self.dbhelper.fti_uid_attr = self.indexer.uid_attr |
157 self.dbhelper.fti_uid_attr = self.indexer.uid_attr |
161 self.dbhelper.fti_table = self.indexer.table |
158 self.dbhelper.fti_table = self.indexer.table |
162 self.dbhelper.fti_restriction_sql = self.indexer.restriction_sql |
159 self.dbhelper.fti_restriction_sql = self.indexer.restriction_sql |
163 self.dbhelper.fti_need_distinct_query = self.indexer.need_distinct |
160 self.dbhelper.fti_need_distinct_query = self.indexer.need_distinct |
|
161 else: |
|
162 self.dbhelper.fti_need_distinct_query = False |
|
163 # sql generator |
|
164 self._rql_sqlgen = self.sqlgen_class(appschema, self.dbhelper, |
|
165 self.encoding, ATTR_MAP.copy()) |
164 # sql queries cache |
166 # sql queries cache |
165 self._cache = Cache(repo.config['rql-cache-size']) |
167 self._cache = Cache(repo.config['rql-cache-size']) |
166 self._temp_table_data = {} |
168 self._temp_table_data = {} |
167 self._eid_creation_lock = Lock() |
169 self._eid_creation_lock = Lock() |
168 # XXX no_sqlite_wrap trick since we've a sqlite locking pb when |
170 # XXX no_sqlite_wrap trick since we've a sqlite locking pb when |