- Bug fix:
BelongsToWrappedthrew aTypeErrorif used with aHashedModelsubclass and.save()was called on one of those wrapped class instances; fixed in both sync and async versions - Bug fix: identical bug discovered and fixed in
HasOneWrapped - Improved documentation for
.join()method of the query builders, explaining how theonparameter works
- Bug fix:
containsrelationreload()raisedValueErrorif the foreign key column was empty- Now it sets an empty tuple as the secondary values instead
- Fixed in both sync and async relations
- Also updated
query()for consistent handling of secondary ids
- Bug fixes: the CLI tool was ignoring connection info strings in files
make migration --modelnow respects model connection string if either ofCONNECTION_STRINGorMAKE_WITH_CONNSTRINGis not setautomigrate/autorollback/autorefreshnow fallback to first migration connection info ifCONNECTION_STRINGis not set- Default of 'temp.db' removed entirely
- Added new documentation file: migrations.md
- Reorganized/improved readme and moved db coupling guide to a new file
- Moved documentation files to new docs/ folder
- Added version information to CLI help text and a
sqloquent versioncommand - Improved CLI help text
- Made some code hygiene updates and misc under-the-hood improvements
- Made the connection pooling and cursor tracking in
SqliteContextthread-local
- Added automatic connection pooling to
SqliteContextandAsyncSqliteContext - Updated
SqlQueryBuilderandAsyncSqlQueryBuilderto use the connection pooling inchunk - Updated packify dependency to 0.3.1
- Improved relation docstrings set by ORM helper functions
- Added library version to CLI help text
- Added
less_or_equalandgreater_or_equalto query builders - Bugfix: ORM now gracefully handles empty
containsrelation foriegn id column
- New method
HashedModel.preimageto get the preimage of the sha256 id in the form of the bytes-serialized non-id, non-excluded columns and their values. - Method
HashedModel.generate_idnow callspreimageinternally.
- Updated migration system to use the
quote_identifierandquote_sql_str_valuefunctions for quoting identifiers and string values. - Updated
quote_identifierto properly quote components in a multi-part identifier and raise ValueError when a component has an unmatched double quotation mark or when the identifier contains a single quote. - Added new unit tests for
quote_identifierandquote_sql_str_value
- Updated query builders to quote identifiers and escape string quotes
- Added support for boolean columns in migration system
- Added casting for boolean columns in query builders
- Added new syntax for declaring default column values on classes
- Added new syntax for declaring default column values in migrations
- Updated migration system to quote identifiers
- Updated tools for generating models and migrations from models to support booleans and default values
- Fixed issues with
data_originalproperty interface (relations, etc.) - Fixed bugs in
to_sqlmethod ofSqlQueryBuilderandAsyncSqlQueryBuilder - Added new syntax for QueryBuilder methods (can not use kwargs to specify multiple conditions of the same type)
- Added change tracking to
SqlModel,AsyncSqlModel, and subclasses - Added event str as keyword arg for event hook calls:
hook(cls, *args, event=event, **kwargs) - Standardized
invoke_hookscalls to include all non-event name args as kwargs;invoke_hookscalls callbacks with(cls, *args, **kwargs), but*argswill be empty
- Fixed documentation links in readme
- Added event hook system to
SqlModeland subclasses
- Patch: updated
SqlModelandAsyncSqlModelthinking there was a bug, but there was not actually a bug .__.
- Fix: corrected
HashedModel.updateandAsyncHashedModel.updateto properly persist changes to non-committed columns
- Fix: corrected ORM property docstring overwrite text (pluralized
withinandasync_within)
- Improved autodox documentation for library users utilizing the ORM helper functions by overwriting relation property docstrings
- Added dependency on
nest-asyncio==1.6.0 - Fixed
RuntimeErrorissues with async ORM implementation - Documented async ORM tendency to occasionally produce
ResourceWarnings
- Fixed several interfaces (
Protocols) for more accurate type hints
- Fix:
HashedModelnow commits to empty columns asNonevalues - Added
columns_excluded_from_hashattribute toHashedModelto exclude some columns of subclasses from sha256 id generation
- Replaced
make_migration_from_modeltool with newmake_migration_from_modelandmake_migration_from_model_path - Added automatic timestamps to the
DeletedModeland the async version - Added
likeandnot_liketo SQB - Added
does_not_start_withto SQB - Added
does_not_end_withto SQB - Fix: can now more reliably access relations through other relations
- Added ability to suppress parameter interpolation in SQB.to_sql method
- Relations now attempt to load automatically on first read of property, e.g.
SomeModel.find(some_id).related_model
- Fixed some type hints
- Reintroduced the disable_column_property_mapping feature
- Added
is_nullandnot_nullto the query builders
- Hotfix for CLI tool.
- CLI
make modelnow accepts--table {table_name}parameters
- Documentation fixes
- Copied almost all synchronous code base and test suite into an async variety
- Added
Contains,Within,AsyncContains,AsyncWithinrelations - Added
contains,within,async_contains,async_withinORM helpers - Improved CLI tool
- CLI
make modelnow accepts--columns name[=type],etcparameters
- Simplified classes (
SqlModelandSqlQueryBuildernow have default sqlite coupling; dropped separate sqlite models) - Refactored connection info handling scheme
- Refactored relations (removed experimental inverse tracking)