363 possible type). If cachekey is given, the query necessary to fetch the |
363 possible type). If cachekey is given, the query necessary to fetch the |
364 results (but not the results themselves) may be cached using this key. |
364 results (but not the results themselves) may be cached using this key. |
365 """ |
365 """ |
366 raise NotImplementedError(self) |
366 raise NotImplementedError(self) |
367 |
367 |
368 def flying_insert(self, table, session, union, args=None, varmap=None): |
|
369 """similar as .syntax_tree_search, but inserts data in the temporary |
|
370 table (on-the-fly if possible, eg for the system source whose the given |
|
371 cursor come from). If not possible, inserts all data by calling |
|
372 .executemany(). |
|
373 """ |
|
374 res = self.syntax_tree_search(session, union, args, varmap=varmap) |
|
375 session.repo.system_source.manual_insert(res, table, session) |
|
376 |
|
377 # write modification api ################################################### |
368 # write modification api ################################################### |
378 # read-only sources don't have to implement methods below |
369 # read-only sources don't have to implement methods below |
379 |
370 |
380 def get_extid(self, entity): |
371 def get_extid(self, entity): |
381 """return the external id for the given newly inserted entity""" |
372 """return the external id for the given newly inserted entity""" |
450 |
441 |
451 def sqlexec(self, session, sql, args=None): |
442 def sqlexec(self, session, sql, args=None): |
452 """execute the query and return its result""" |
443 """execute the query and return its result""" |
453 raise NotImplementedError(self) |
444 raise NotImplementedError(self) |
454 |
445 |
455 def temp_table_def(self, selection, solution, table, basemap): |
|
456 raise NotImplementedError(self) |
|
457 |
|
458 def create_index(self, session, table, column, unique=False): |
446 def create_index(self, session, table, column, unique=False): |
459 raise NotImplementedError(self) |
447 raise NotImplementedError(self) |
460 |
448 |
461 def drop_index(self, session, table, column, unique=False): |
449 def drop_index(self, session, table, column, unique=False): |
462 raise NotImplementedError(self) |
450 raise NotImplementedError(self) |
463 |
|
464 def create_temp_table(self, session, table, schema): |
|
465 raise NotImplementedError(self) |
|
466 |
|
467 def clean_temp_data(self, session, temptables): |
|
468 """remove temporary data, usually associated to temporary tables""" |
|
469 pass |
|
470 |
451 |
471 |
452 |
472 @deprecated('[3.13] use repo.eid2extid(source, eid, session)') |
453 @deprecated('[3.13] use repo.eid2extid(source, eid, session)') |
473 def eid2extid(self, eid, session=None): |
454 def eid2extid(self, eid, session=None): |
474 return self.repo.eid2extid(self, eid, session) |
455 return self.repo.eid2extid(self, eid, session) |