Commit a73c543c authored by Sylvain Thénault's avatar Sylvain Thénault
Browse files

Use the massive store for initial creation of concept schemes

when the instance's backend is postgres.
parent 488fb224e689
......@@ -23,7 +23,6 @@ from os.path import join, dirname
from six import text_type
from cubicweb.dataimport.stores import NoHookRQLObjectStore
from cubicweb.dataimport.importer import SimpleImportLog
from cubes.skos import lcsv, sobjects as skos
......@@ -108,7 +107,12 @@ def lcsv_check(cnx, store, fname, scheme_uri):
def import_seda_schemes(cnx, lcsv_import=lcsv_import):
"""Import all LCSV data files defined in LCSV_FILES"""
store = NoHookRQLObjectStore(cnx)
if cnx.repo.system_source.dbdriver == 'postgres':
from cubicweb.dataimport.massive_store import MassiveObjectStore
store = MassiveObjectStore(cnx, eids_seq_range=1000)
else:
from cubicweb.dataimport.stores import NoHookRQLObjectStore
store = NoHookRQLObjectStore(cnx)
for title, rtypes, etypes, fname in LCSV_FILES:
if not cnx.find('ConceptScheme', title=title):
print('importing', title.encode('utf-8'))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment