Commit e7e73e22 authored by François Ferry's avatar François Ferry
Browse files

docs(dataimport): remove SQLGenObjectStore description and add MassiveObjectStore.

SQLGenObjectStore is deprecated since 3.23 and is no more in CW.

related: #75
parent 382cd72af7e6
Pipeline #28022 failed with stages
in 37 minutes and 25 seconds
......@@ -16,7 +16,9 @@
#
# You should have received a copy of the GNU Lesser General Public License along
# with CubicWeb. If not, see <http://www.gnu.org/licenses/>.
"""
.. autoclass:: cubicweb.dataimport.massive_store.MassiveObjectStore
"""
from collections import defaultdict
from itertools import chain
import logging
......
......@@ -78,9 +78,31 @@ Stores
.. automodule:: cubicweb.dataimport.stores
SQLGenObjectStore
-----------------
MassiveObjectStore
------------------
This store relies on *COPY FROM* sql commands to directly push data using SQL commands
rather than using the whole *CubicWeb* API. For now, **it only works with PostgreSQL** as it requires
the *COPY FROM* command. Anything related to CubicWeb (Hooks, for instance), are bypassed. It
inserts entities directly by using one PostgreSQL ``COPY FROM`` query for a set of similarly
structured entities.
This store is the fastest, if the table is small compared to the volume of data to insert.
Indeed, it removes all indexes and constraints on the table before importing, and reapply them
at the end. This means that if the table is small compared to the amount of data you want to insert,
this store is better than the others.
NOTE: Because inlined [#]_ relations are stored in the entity’s table, they must be set as any
other attributes of the entity. For instance:
.. code-block:: python
store.prepare_insert_entity("MyEType", name="toto", favorite_email=email_address.eid)
.. [#] An inlined relation is a relation defined in the schema
with the keyword argument ``inlined=True``. Such a relation
is inserted in the database as an attribute of the entity
whose subject it is.
.. automodule:: cubicweb.dataimport.massive_store
This store relies on *COPY FROM*/execute many sql commands to directly push data using SQL commands
rather than using the whole *CubicWeb* API. For now, **it only works with PostgresSQL** as it requires
the *COPY FROM* command.
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