coolqlite.from_sql

Helpers for configuring cattrs with our default good-practices converters.

coolqlite.from_sql.configure_converter_datetimes(conv: BaseConverter)

Configure the given converter with structure hooks for the various datetype types.

coolqlite.from_sql.configure_strict_primitives(conv: BaseConverter)
coolqlite.from_sql.configure_union_passthrough(conv: BaseConverter)
coolqlite.from_sql.configure_converter() Converter
coolqlite.from_sql.configure_converter(conv: T | None = None) T

Configure a converter with our good-practices defaults. If not given, creates a new cattrs.Converter .

coolqlite.from_sql.datetime_

Simple functions for converting from strings to datetype DateTimes.

These all take an optional and ignored second argument so they can be used as cattrs structure hooks.

coolqlite.from_sql.datetime_.dt_from_iso(data: str, _ignored=None, /) DateTime

Deserialize a DateTime from an iso-formatted string.

coolqlite.from_sql.datetime_.naive_dt_from_iso(data: str, _ignored=None, /) NaiveDateTime

Deserialize a NaiveDateTime from an iso-formatted string.

Raises a TypeError if the string had timezone information.

coolqlite.from_sql.datetime_.aware_dt_from_iso(data: str, _ignored=None, /) AwareDateTime

Deserialize an AwareDateTime from an iso-formatted string.

Raises a TypeError if the string was missing timezone information.

coolqlite.from_sql.datetime_.time_from_iso(data: str, _ignored=None, /) Time
coolqlite.from_sql.datetime_.aware_time_from_iso(data: str, _ignored=True, /) AwareTime
coolqlite.from_sql.datetime_.naive_time_from_iso(data: str, _ignored=True, /) NaiveTime
coolqlite.from_sql.datetime_.date_from_iso(data: str, _ignored=None, /) Date