DataStoreSqlite#

class DataStoreSqlite(*args, **kwargs)#
Attributes:
completed
db
describe
limit
locked

returns if lock_pid is NULL or doesn’t exist.

logs

returns all log records

members
mode

string that references datastore mode, override in override in subclass constructor

not_completed

returns database records of type NotCompleted

record_type

class name of completed results

source

string that references connecting to data store, override in subclass constructor

summary_logs

returns a table summarising log files

summary_not_completed

returns a table summarising not completed results

Methods

lock()

if writable, and not locked, locks the database to this pid

md5(unique_id)

Parameters:

read(identifier)

identifier string formed from Path(table_name) / identifier

unlock([force])

remove a lock if pid matches.

write(*, unique_id, data)

writes a completed record ending with .suffix

write_not_completed(*, unique_id, data)

writes a not completed record as json

close

drop_not_completed

validate

write_log

close()#
property completed#
property db#
property describe#
drop_not_completed(*, unique_id: str = '') None#
property limit#
lock()#

if writable, and not locked, locks the database to this pid

property locked: bool#

returns if lock_pid is NULL or doesn’t exist.

property logs#

returns all log records

md5(unique_id: str) str | None#
Parameters:
unique_id

name of data store member

Returns
——-
md5 checksum for the member, if available, None otherwise
property members: list[DataMemberABC]#
property mode: Mode#

string that references datastore mode, override in override in subclass constructor

property not_completed#

returns database records of type NotCompleted

read(identifier: str) str | bytes#

identifier string formed from Path(table_name) / identifier

property record_type: str#

class name of completed results

property source: str | Path#

string that references connecting to data store, override in subclass constructor

store_suffix = 'sqlitedb'#
property summary_logs: TabularType#

returns a table summarising log files

property summary_not_completed: TabularType#

returns a table summarising not completed results

unlock(force=False)#

remove a lock if pid matches. If force, ignores pid. ignored if mode is READONLY

validate() TabularType#
write(*, unique_id: str, data: str | bytes) DataMemberABC#

writes a completed record ending with .suffix

Parameters:
unique_id

unique identifier

data

text data to be written

Returns:
a member for this record

Notes

Drops any not-completed member corresponding to this identifier

write_log(*, unique_id: str, data: str | bytes) None#
write_not_completed(*, unique_id: str, data: str | bytes) DataMemberABC#

writes a not completed record as json

Parameters:
unique_id

unique identifier

data

text data to be written

Returns:
a member for this record