Ormagic

Latest version: v0.15.0

Safety actively analyzes 688027 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 3 of 4

0.8.0

Not secure
The latest version focuses on enhancing filter capabilities and ensuring comprehensive test coverage. Here are the key changes:

New Features
- Added support for various query operators in the `DBModel` filter method: `BETWEEN`, `NOT LIKE`, `NOT IN`, `IN`, `LIKE`, `lt`, `lte`, `gt`, `gte`, and `not equal`.

Refactoring
- Refactored methods for preparing and handling where conditions to support the new operators and improve code maintainability.

Tests
- Added comprehensive tests for all newly supported filter operators.
- Refactored tests to use prepared data from `prepare_db` for consistency and efficiency.

Documentation
- Updated the `README.md` to document new filter options and mark completed tasks in the checklist.

In summary, this update significantly enhances the filtering capabilities of the `DBModel` and ensures robust testing and documentation for these new features.

Features and Roadmap

- [x] Define table schema using Pydantic models
- [x] Basic CRUD operations
- [x] Save data to the database
- [x] Read data from the database
- [x] Update data in the database
- [x] Delete data from the database
- [x] Relationships between tables
- [x] One-to-many
- [x] Create a tables with a foreign key
- [x] Save data with a foreign key
- [x] Read data with a foreign key
- [x] Update data with a foreign key
- [x] Delete data with a foreign key
- [X] Cascade
- [x] Set null
- [x] Restrict
- [x] Set default
- [x] No action
- [x] One-to-one
- [x] Many-to-many
- [x] Unique constraints
- [x] Remove table
- [x] Read all data from the database
- [x] Filter data and retrieve multiple records
- [x] Equal
- [x] Not equal
- [x] Greater than
- [x] Greater than or equal
- [x] Less than
- [x] Less than or equal
- [x] Like (Pattern matching with % and _)
- [x] Not like (Pattern matching with % and _)
- [x] In (List of values)
- [x] Not in (List of values)
- [x] Between (Two values)
- [x] Not between (Two values)
- [ ] Pagination
- [ ] Order by
- [ ] Update table schema
- [ ] Custom primary key
- [ ] Bulk operations (save, update, delete)
- [ ] Migrations

**Full Changelog**: https://github.com/SpaceShaman/ORMagic/compare/v0.7.0...v0.8.0

0.7.0

Not secure
The latest version introduces the `DBField` function to extend Pydantic's `Field` for more customized database operations. Here are the main changes:

New Features
- Created the `DBField` function in `fields.py` to extend Pydantic's `Field`.
- Replaced `Field` with `DBField` in the codebase to support custom `on_delete` and `unique` options.

Features and Roadmap

- [x] Define table schema using Pydantic models
- [x] Basic CRUD operations
- [x] Save data to the database
- [x] Read data from the database
- [x] Update data in the database
- [x] Delete data from the database
- [x] Relationships between tables
- [x] One-to-many
- [x] Create a tables with a foreign key
- [x] Save data with a foreign key
- [x] Read data with a foreign key
- [x] Update data with a foreign key
- [x] Delete data with a foreign key
- [X] Cascade
- [x] Set null
- [x] Restrict
- [x] Set default
- [x] No action
- [x] One-to-one
- [x] Many-to-many
- [x] Unique constraints
- [x] Remove table
- [x] Read all data from the database
- [ ] Filter data and retrieve multiple records
- [x] Equal
- [ ] Not equal
- [ ] Greater than
- [ ] Greater than or equal
- [ ] Less than
- [ ] Less than or equal
- [ ] Contains
- [ ] Pagination
- [ ] Update table schema
- [ ] Custom primary key
- [ ] Bulk operations (save, update, delete)
- [ ] Migrations

**Full Changelog**: https://github.com/SpaceShaman/ORMagic/compare/v0.6.1...v0.7.0

0.6.1

Not secure
The latest version includes a hotfix to address issues with fetching data for many-to-many relationships, specifically fixing an infinite recursion problem. Here are the main changes:

Code Refactoring
- Updated the `_process_raw_data` method in `models.py` to accept an `is_recursive_call` parameter.
- Added the `is_recursive_call` parameter to the `_fetchone_raw_data` method to prevent infinite recursion.

In summary, this hotfix resolves an infinite recursion issue when fetching data for many-to-many relationships.

Features and Roadmap

- [x] Define table schema using Pydantic models
- [x] Basic CRUD operations
- [x] Save data to the database
- [x] Read data from the database
- [x] Update data in the database
- [x] Delete data from the database
- [x] Relationships between tables
- [x] One-to-many
- [x] Create a tables with a foreign key
- [x] Save data with a foreign key
- [x] Read data with a foreign key
- [x] Update data with a foreign key
- [x] Delete data with a foreign key
- [X] Cascade
- [x] Set null
- [x] Restrict
- [x] Set default
- [x] No action
- [x] One-to-one
- [x] Many-to-many
- [x] Unique constraints
- [x] Remove table
- [x] Read all data from the database
- [ ] Filter data and retrieve multiple records
- [x] Equal
- [ ] Not equal
- [ ] Greater than
- [ ] Greater than or equal
- [ ] Less than
- [ ] Less than or equal
- [ ] Contains
- [ ] Pagination
- [ ] Update table schema
- [ ] Custom primary key
- [ ] Bulk operations (save, update, delete)
- [ ] Migrations

**Full Changelog**: https://github.com/SpaceShaman/ORMagic/compare/v0.6.0...v0.6.1

0.6.0

Not secure
The latest version introduces significant enhancements, new features, and refactorings focusing on many-to-many relationships, improved data integrity, and better code readability. Here are the main changes:

Code Refactoring
- Added foreign key constraints with `ON DELETE CASCADE` to maintain referential integrity in database relations.
- Extracted logic to check and create intermediate tables for many-to-many relationships into separate methods for better readability and
maintainability.
- Optimized the `_insert` method to handle many-to-many fields.
- Renamed `_prepare_values_to_insert` method to `_prepare_data_to_insert` for clarity and consistency.
- Simplified the `delete`, `insert`, and `update` methods to use the `table_name` property instead of class names.
- Removed commented-out and unused methods to clean up code.
- Renamed and refactored methods for fetching and processing raw data for better organization and readability.
- Extracted logic for processing many-to-many data into separate methods.

New Features
- Added support for creating middleware tables for many-to-many relationships in the database.
- Introduced the `_get_intermediate_table_name` method to handle intermediate tables.
- Enhanced the `save` method to handle optional foreign keys with `None` values.
- Added the `_insert_many_to_many` method to manage the insertion of related objects in many-to-many relationships.
- Updated foreign key constraints to include `ON UPDATE CASCADE` for better data integrity and consistency.
- Added support for fetching all raw data and fetching one raw data with optional foreign key relationships.
- Added a method to update many-to-many intermediate tables when updating or inserting a `DBModel` instance.
- Provided a property to get table names dynamically based on class names.

Tests
- Added tests for creating database tables with many-to-many relationships.
- Added tests for saving objects with many-to-many relationships.
- Added tests for the `_prepare_data_to_insert` method to ensure correct data preparation for insertion.
- Added tests for fetching raw data with and without foreign key relationships.
- Added tests for fetching raw data with many-to-many relationships.
- Added tests for the `_get_intermediate_table_name` method.
- Reorganized class definitions in test files to match the one-to-many and many-to-many relationships correctly.

Documentation
- Updated the task list in `README.md` to include different filter options and pagination support for filtering data and retrieving multiple records.
- Added integration examples with FastAPI for the ORMagic library.
- Updated links to Pydantic and FastAPI for better readability and accessibility.
- Added documentation for defining many-to-many relationships in models.

In summary, this version significantly enhances the support for many-to-many relationships, improves data integrity, and ensures better code maintainability and readability.

Features and Roadmap

- [x] Define table schema using Pydantic models
- [x] Basic CRUD operations
- [x] Save data to the database
- [x] Read data from the database
- [x] Update data in the database
- [x] Delete data from the database
- [x] Relationships between tables
- [x] One-to-many
- [x] Create a tables with a foreign key
- [x] Save data with a foreign key
- [x] Read data with a foreign key
- [x] Update data with a foreign key
- [x] Delete data with a foreign key
- [X] Cascade
- [x] Set null
- [x] Restrict
- [x] Set default
- [x] No action
- [x] One-to-one
- [x] Many-to-many
- [x] Unique constraints
- [x] Remove table
- [ ] Filter data and retrieve multiple records
- [x] Equal
- [ ] Not equal
- [ ] Greater than
- [ ] Greater than or equal
- [ ] Less than
- [ ] Less than or equal
- [ ] Contains
- [ ] Pagination
- [x] Read all data from the database
- [ ] Update table schema
- [ ] Custom primary key
- [ ] Bulk operations (save, update, delete)
- [ ] Migrations

**Full Changelog**: https://github.com/SpaceShaman/ORMagic/compare/v0.5.1...v0.6.0

0.5.1

Not secure
The latest version includes a quick hotfix to handle exceptions and ensure proper connection management. Here are the main changes:

Fixes
- Fixed the `execute_sql` function in `sql_utils.py` to handle exceptions and close the connection properly.

Tests
- Added tests in `test_close_sqlite_connection_after_exception.py` to ensure proper handling of `IntegrityError` and `OperationalError` in `DBModel`.

In summary, this version improves exception handling and connection management.

Features and Roadmap

- [x] Define table schema using Pydantic models
- [x] Basic CRUD operations
- [x] Save data to the database
- [x] Read data from the database
- [x] Update data in the database
- [x] Delete data from the database
- [ ] Relationships between tables
- [x] One-to-many
- [x] Create a tables with a foreign key
- [x] Save data with a foreign key
- [x] Read data with a foreign key
- [x] Update data with a foreign key
- [x] Delete data with a foreign key
- [X] Cascade
- [x] Set null
- [x] Restrict
- [x] Set default
- [x] No action
- [x] One-to-one
- [ ] Many-to-many
- [x] Unique constraints
- [x] Remove table
- [x] Filter data and retrieve multiple records
- [x] Read all data from the database
- [ ] Update table schema
- [ ] Custom primary key
- [ ] Bulk operations (save, update, delete)
- [ ] Migrations

**Full Changelog**: https://github.com/SpaceShaman/ORMagic/compare/v0.5.0...v0.5.1

0.5.0

Not secure
In summary, this version introduces new methods for data retrieval and filtering, and includes comprehensive tests to ensure the correct functionality of these new features.

New Features
- Added a new class method `all` to `DBModel` for retrieving all objects from the database.
- Introduced a `filter` class method to `DBModel` for querying objects based on keyword arguments.

Code Refactoring
- Optimized the `get` method by extracting common logic into the `_fetch_raw_data` method in `models.py`.
- Improved the `_create_instance_from_data` method in `models.py` to handle Iterable data input instead of a tuple.

Features and Roadmap

- [x] Define table schema using Pydantic models
- [x] Basic CRUD operations
- [x] Save data to the database
- [x] Read data from the database
- [x] Update data in the database
- [x] Delete data from the database
- [ ] Relationships between tables
- [x] One-to-many
- [x] Create a tables with a foreign key
- [x] Save data with a foreign key
- [x] Read data with a foreign key
- [x] Update data with a foreign key
- [x] Delete data with a foreign key
- [X] Cascade
- [x] Set null
- [x] Restrict
- [x] Set default
- [x] No action
- [x] One-to-one
- [ ] Many-to-many
- [x] Unique constraints
- [x] Remove table
- [x] Filter data and retrieve multiple records
- [x] Read all data from the database
- [ ] Update table schema
- [ ] Custom primary key
- [ ] Bulk operations (save, update, delete)
- [ ] Migrations

**Full Changelog**: https://github.com/SpaceShaman/ORMagic/compare/v0.4.1...v0.5.0

Page 3 of 4

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.