Documentation changes
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
"""
|
"""
|
||||||
This module includes functions to insert multiple records
|
This module includes functions to insert multiple records
|
||||||
to a bound database at one time, with one time open and closing
|
to a bound database at one time, with one time open and closing
|
||||||
of the database file.
|
of the database file.
|
||||||
"""
|
"""
|
||||||
from typing import TypeVar, Union, List, Tuple
|
from typing import TypeVar, Union, List, Tuple
|
||||||
from dataclasses import asdict
|
from dataclasses import asdict
|
||||||
@@ -15,7 +15,7 @@ T = TypeVar('T')
|
|||||||
|
|
||||||
class HeterogeneousCollectionError(Exception):
|
class HeterogeneousCollectionError(Exception):
|
||||||
"""
|
"""
|
||||||
:raises if the passed collection is not homogeneous.
|
:raise : if the passed collection is not homogeneous.
|
||||||
ie: If a List or Tuple has elements of multiple
|
ie: If a List or Tuple has elements of multiple
|
||||||
types.
|
types.
|
||||||
"""
|
"""
|
||||||
@@ -25,7 +25,7 @@ class HeterogeneousCollectionError(Exception):
|
|||||||
def _check_homogeneity(objects: Union[List[T], Tuple[T]]) -> None:
|
def _check_homogeneity(objects: Union[List[T], Tuple[T]]) -> None:
|
||||||
"""
|
"""
|
||||||
Check if all of the members a Tuple or a List
|
Check if all of the members a Tuple or a List
|
||||||
is of the same type.
|
is of the same type.
|
||||||
|
|
||||||
:param objects: Tuple or list to check.
|
:param objects: Tuple or list to check.
|
||||||
:return: If all of the members of the same type.
|
:return: If all of the members of the same type.
|
||||||
@@ -89,7 +89,7 @@ def _mass_insert(objects: Union[List[T], Tuple[T]], db_name: str, protect_memory
|
|||||||
def create_many(objects: Union[List[T], Tuple[T]], protect_memory: bool = True) -> None:
|
def create_many(objects: Union[List[T], Tuple[T]], protect_memory: bool = True) -> None:
|
||||||
"""
|
"""
|
||||||
Insert many records corresponding to objects
|
Insert many records corresponding to objects
|
||||||
in a tuple or a list.
|
in a tuple or a list.
|
||||||
|
|
||||||
:param protect_memory: If False, memory protections are turned off,
|
:param protect_memory: If False, memory protections are turned off,
|
||||||
makes it faster.
|
makes it faster.
|
||||||
@@ -106,8 +106,8 @@ def create_many(objects: Union[List[T], Tuple[T]], protect_memory: bool = True)
|
|||||||
def copy_many(objects: Union[List[T], Tuple[T]], db_name: str, protect_memory: bool = True) -> None:
|
def copy_many(objects: Union[List[T], Tuple[T]], db_name: str, protect_memory: bool = True) -> None:
|
||||||
"""
|
"""
|
||||||
Copy many records to another database, from
|
Copy many records to another database, from
|
||||||
their original database to new database,
|
their original database to new database, do
|
||||||
do not delete old records.
|
not delete old records.
|
||||||
|
|
||||||
:param objects: Objects to copy.
|
:param objects: Objects to copy.
|
||||||
:param db_name: Name of the new database.
|
:param db_name: Name of the new database.
|
||||||
|
|||||||
Reference in New Issue
Block a user