Skip to content

Commit

Permalink
docs: add note about commit() (#157)
Browse files Browse the repository at this point in the history
  • Loading branch information
jsstevenson authored Jun 5, 2024
1 parent 9633d0c commit c4e620b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/store.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,12 @@ To add a new sequence and/or aliases in a Python environment, construct a ``SeqR
n_seqs_added, n_aliases_added = sr.store(sequence, nsaliases)
print(n_seqs_added, n_aliases_added)
# (1, 1)
sr.commit()
``store()`` returns a tuple containing the number of new sequences and aliases that were successfully added (the sha512t24u sequence hash is not counted as a new alias, because it is automatically added with a new sequence as the main sequence identifier).

Note that the ``commit()`` method MUST be called before the end of an interpreter session for data to be durably committed to the database. ``store()`` only stages pending database additions, but only makes calls to ``commit()`` when the number of staged changes exceeds a (relatively large) threshold, for performance reasons.

.. and this should be a "tip" admonition or something of that nature
Load FASTA files
Expand Down

0 comments on commit c4e620b

Please sign in to comment.