mirror of
https://github.com/simonw/sqlite-utils.git
synced 2026-07-25 18:34:32 +02:00
A bunch of minor fixes
This commit is contained in:
parent
4106264983
commit
83f8bc2eaa
6 changed files with 19 additions and 17 deletions
|
|
@ -237,36 +237,43 @@ if pd:
|
|||
|
||||
class AlterError(Exception):
|
||||
"Error altering table"
|
||||
|
||||
pass
|
||||
|
||||
|
||||
class NoObviousTable(Exception):
|
||||
"Could not tell which table this operation refers to"
|
||||
|
||||
pass
|
||||
|
||||
|
||||
class NoTable(Exception):
|
||||
"Specified table does not exist"
|
||||
|
||||
pass
|
||||
|
||||
|
||||
class BadPrimaryKey(Exception):
|
||||
"Table does not have a single obvious primary key"
|
||||
|
||||
pass
|
||||
|
||||
|
||||
class NotFoundError(Exception):
|
||||
"Record not found"
|
||||
|
||||
pass
|
||||
|
||||
|
||||
class PrimaryKeyRequired(Exception):
|
||||
"Primary key needs to be specified"
|
||||
|
||||
pass
|
||||
|
||||
|
||||
class InvalidColumns(Exception):
|
||||
"Specified columns do not exist"
|
||||
|
||||
pass
|
||||
|
||||
|
||||
|
|
@ -3203,7 +3210,7 @@ class Table(Queryable):
|
|||
:param not_null: Set of strings specifying columns that should be ``NOT NULL``.
|
||||
:param defaults: Dictionary specifying default values for specific columns.
|
||||
:param hash_id: Name of a column to create and use as a primary key, where the
|
||||
value of thet primary key will be derived as a SHA1 hash of the other column values
|
||||
value of that primary key will be derived as a SHA1 hash of the other column values
|
||||
in the record. ``hash_id="id"`` is a common column name used for this.
|
||||
:param alter: Boolean, should any missing columns be added automatically?
|
||||
:param ignore: Boolean, if a record already exists with this primary key, ignore this insert.
|
||||
|
|
@ -3852,7 +3859,7 @@ def jsonify_if_needed(value):
|
|||
|
||||
|
||||
def resolve_extracts(
|
||||
extracts: Optional[Union[Dict[str, str], List[str], Tuple[str]]]
|
||||
extracts: Optional[Union[Dict[str, str], List[str], Tuple[str]]],
|
||||
) -> dict:
|
||||
if extracts is None:
|
||||
extracts = {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue