Skip to content

Transition 2.0 to 3.0 #939

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 411 commits into from
Jun 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
411 commits
Select commit Hold shift + click to select a range
22a5c01
black formatted
josephmancuso Dec 6, 2023
e8c6a50
Added method "only" to model class.
Dec 9, 2023
5da5423
updated only to support aliasing attribute names. This can be useful …
Dec 9, 2023
bf8ff3f
Update Model.py
JarriqTheTechie Dec 9, 2023
57aa5cf
Update setup.py
josephmancuso Dec 10, 2023
1492f7a
fixed issue. needs refactoring
josephmancuso Jan 4, 2024
7297bac
removed prints
josephmancuso Jan 4, 2024
b44e74f
fixed php ini
josephmancuso Jan 4, 2024
0afd57e
formatted
josephmancuso Jan 4, 2024
ea7f06e
format
josephmancuso Jan 4, 2024
5eb85f2
Merge branch 'features/only' of https://github.com/JarriqTheTechie/or…
josephmancuso Jan 4, 2024
b9ba91d
added check for strings
josephmancuso Jan 4, 2024
427fc9d
added tests
josephmancuso Jan 4, 2024
98a6393
Merge pull request #866 from JarriqTheTechie/features/only
josephmancuso Jan 4, 2024
c11fcc4
Merge pull request #868 from MasoniteFramework/fix/816
josephmancuso Jan 4, 2024
1a3b0c4
BaseRelationship: s/self/instance
pmn4 Feb 12, 2024
378b8c3
Mysql close the connection on rollback
felipehertzer Feb 23, 2024
6f44e9b
feat: add `Collection.min` method
amirhoseinsalimi Mar 3, 2024
61749cc
fix: fix a typo in docs of `Collection.max`
amirhoseinsalimi Mar 3, 2024
e7defe2
Merge pull request #870 from felipehertzer/patch-1
josephmancuso Mar 5, 2024
11fd4d9
Merge pull request #872 from amirhoseinsalimi/patch-1
josephmancuso Mar 12, 2024
f487eaa
Merge branch 'feature/collection-min' of https://github.com/amirhosei…
josephmancuso Mar 12, 2024
3bc3406
added min test
josephmancuso Mar 12, 2024
1ea4d60
Merge pull request #874 from amirhoseinsalimi/feature/collection-min
josephmancuso Mar 12, 2024
cc30732
linted
josephmancuso Mar 12, 2024
f963387
Update setup.py
josephmancuso Mar 12, 2024
29426df
wip: hasmany performance fix
eaguad1337 Apr 2, 2024
a6a5eea
fixed tests and made attempt
josephmancuso Apr 3, 2024
64585fb
fix: tests
eaguad1337 Apr 6, 2024
9393f8e
fix: foreign key call
eaguad1337 Apr 6, 2024
41c49c4
removed print
josephmancuso Apr 6, 2024
d6f2528
Merge pull request #880 from MasoniteFramework/fix/relationship-perfo…
josephmancuso Apr 6, 2024
6f93468
Update setup.py
josephmancuso Apr 6, 2024
c9e7617
Merge pull request #869 from pmn4/pmn4.base-relationship
josephmancuso Apr 7, 2024
2916fc4
add configuration option to enable or disable foreign keys check for …
martinszemitis May 1, 2024
0524421
Merge pull request #883 from martinszemitis/2.0
josephmancuso Jun 9, 2024
f670552
fix: values in compile_alter_sql
Kyrela Jun 19, 2024
fff45ac
lint: remove additional blank line at end of file
Kyrela Jun 19, 2024
8e6a27b
tests: `test_can_add_column_enum` and `test_can_change_column_enum`
Kyrela Jun 19, 2024
ec31a17
tests: `test_can_add_enum`
Kyrela Jun 19, 2024
ab39abf
fix: values in compile_alter_sql
Kyrela Jun 20, 2024
736eaf8
fixed query builder
josephmancuso Jun 27, 2024
5649282
Merge pull request #885 from Kyrela/2.0
josephmancuso Jul 30, 2024
e4459d6
fixed has many though relationship
josephmancuso Aug 18, 2024
25a965a
fixed has many
josephmancuso Sep 1, 2024
8c9a6bb
fixed querybuilder
josephmancuso Sep 1, 2024
bff9d8b
fixed eager load
josephmancuso Sep 1, 2024
100c791
Merge pull request #890 from MasoniteFramework/hotfix/has-many
josephmancuso Sep 1, 2024
0d0411f
bumped version
josephmancuso Sep 1, 2024
a43ed0e
Merge branch '2.0' of https://github.com/MasoniteFramework/orm into h…
josephmancuso Sep 1, 2024
15eca45
Merge pull request #889 from MasoniteFramework/hotfix/fix-has_many_th…
josephmancuso Sep 1, 2024
e2bb610
bumped version
josephmancuso Sep 1, 2024
26fcdba
fixed missing where on has many through relationship
josephmancuso Sep 1, 2024
60c8d1e
Merge pull request #891 from MasoniteFramework/hotfix/has-many-throug…
josephmancuso Sep 1, 2024
637ae01
bumped version
josephmancuso Sep 1, 2024
4671816
fixed version
josephmancuso Sep 1, 2024
2649b5d
use scopes helper method
circulon Sep 10, 2024
c9f4065
make QueryBuilder find respect scopes
circulon Sep 10, 2024
c4bc92b
Added modles testts using scope
circulon Sep 10, 2024
f4dda56
consolidate duplicated calls
circulon Sep 10, 2024
1ca31b1
Fixed queryBuilder .all() test
circulon Sep 10, 2024
7e07531
fixed query=True not returning builder
circulon Sep 10, 2024
10e6478
use raw sql for clarity
circulon Sep 10, 2024
27760ed
updated Model find and create
circulon Sep 10, 2024
43a80e5
moved find scope tests in with other tests
circulon Sep 11, 2024
7e2e551
Fixed HasOneThrough not loading distant model
circulon Oct 17, 2024
1ac4d29
Fixed HasOneThrough with additional queries
circulon Oct 18, 2024
4f41fc9
Fixed tests
circulon Oct 18, 2024
9cdf560
Update pendulum version requirement
josephmancuso Oct 18, 2024
511e20c
Update pendulum version requirement
josephmancuso Oct 18, 2024
d534e28
Update pendulum version requirement
josephmancuso Oct 18, 2024
4114949
Merge pull request #898 from MasoniteFramework/feature/876-1
josephmancuso Oct 18, 2024
d5433af
Update setup.py
josephmancuso Oct 18, 2024
817e44e
removed unused importsa and duplicate test
circulon Oct 20, 2024
79fad5f
Fixed linting
circulon Oct 20, 2024
59e6d1b
Fixed typos
circulon Oct 20, 2024
7d30357
Fixed eager loading
circulon Oct 20, 2024
80aeb84
Added tests for HasOneThrough eager loading
circulon Oct 20, 2024
cd40bf9
removed unused import
circulon Oct 20, 2024
ad33eff
removed unused imports
circulon Oct 20, 2024
d377d37
Fixed using .first()
circulon Oct 21, 2024
19eda09
Refactor MySQLConnection to use connection pooling
josephmancuso Oct 21, 2024
8a66a07
Update version and dependencies in setup.py
josephmancuso Oct 21, 2024
fd7d200
Refactor PostgresConnection to use connection pooling
josephmancuso Oct 22, 2024
e033bfd
fixed .on_null and .on_not_null had to be last criteria
circulon Oct 24, 2024
afb140b
updated tests fo .on_null and .on_not_null
circulon Oct 25, 2024
1efddf6
Merge pull request #901 from circulon/fix/on_null_always_last_criteria
josephmancuso Oct 26, 2024
8d5da73
Merge pull request #893 from circulon/fix/find_cannot_use_scopes
josephmancuso Oct 26, 2024
55ff6dd
Merge pull request #895 from circulon/fix/has_one_through_not_working
josephmancuso Oct 26, 2024
3ff0a83
Refactor MySQLConnection to use connection pooling
josephmancuso Oct 26, 2024
bc08c93
Refactor MySQLConnection to use connection pooling and add connection…
josephmancuso Oct 27, 2024
28418eb
Refactor MySQLConnection to use connection pooling and initialize con…
josephmancuso Oct 27, 2024
341db08
Refactor MySQLConnection to use connection pooling and remove debug p…
josephmancuso Oct 27, 2024
1ad5ad7
Refactor MySQLConnection to use connection pooling and update connect…
josephmancuso Oct 27, 2024
ba7372f
Refactor MySQLConnection to use connection pooling and update connect…
josephmancuso Oct 27, 2024
cf9bc84
Refactor MySQLConnection to use connection pooling and update connect…
josephmancuso Oct 27, 2024
3010894
Refactor MySQLConnection to use connection pooling and update connect…
josephmancuso Oct 27, 2024
db112ca
format
josephmancuso Oct 27, 2024
8291bc7
Refactor PostgresConnection to use connection pooling and update conn…
josephmancuso Oct 27, 2024
4cbd0e4
Refactor PostgresConnection to remove unused variable
josephmancuso Oct 27, 2024
a4656b9
Refactor PostgresConnection to enable connection pooling with a maxim…
josephmancuso Oct 27, 2024
6a237fa
Refactor database configuration to update connection pool minimum size
josephmancuso Oct 27, 2024
6c4ff02
Refactor SQLiteConnection to use a separate method for creating the c…
josephmancuso Oct 27, 2024
d14c826
Refactor SQLiteConnection to use a separate method for creating the c…
josephmancuso Oct 27, 2024
76590f8
linted
josephmancuso Oct 27, 2024
d28435b
Refactor PostgresConnection to handle closed connections during query…
josephmancuso Oct 27, 2024
9475b9e
Refactor PostgresConnection to handle closed connections during query…
josephmancuso Oct 27, 2024
09d082b
Refactor MySQLConnection to handle closed connections during query ex…
josephmancuso Oct 27, 2024
e466282
Refactor MySQLConnection to handle closed connections during query ex…
josephmancuso Oct 27, 2024
94b1347
Refactor MySQLConnection to handle closed connections during query ex…
josephmancuso Oct 27, 2024
fd6785f
linted
josephmancuso Oct 27, 2024
0468c45
Refactor MySQLConnection to handle closed connections during query ex…
josephmancuso Oct 27, 2024
d7a8895
Merge branch '2.0' into fix/query_true_should_return_query_builder
josephmancuso Oct 28, 2024
15894aa
Merge pull request #892 from circulon/fix/query_true_should_return_qu…
josephmancuso Oct 28, 2024
7a6e7a8
linted
josephmancuso Oct 28, 2024
9cb1d47
fixed HasManyThrough eager loading
circulon Oct 29, 2024
bd10fce
fixed HasManyThrough related model load
circulon Oct 29, 2024
928bbb7
cleaned up and fixed where clauses for HasManyThrough
circulon Oct 29, 2024
c13750e
separated HasOneThrough and HasManyThrough tests
circulon Oct 29, 2024
a3e775b
fixed queriy tests
circulon Oct 29, 2024
ab9308a
make sure related attribute always contains a Collection
circulon Oct 29, 2024
f0c2359
Added ability so specify default select criteria for Models
circulon Oct 30, 2024
3451fd6
Merge pull request #904 from circulon/feature/902
josephmancuso Oct 30, 2024
ce25c0a
Merge pull request #900 from MasoniteFramework/feature/483
josephmancuso Oct 30, 2024
bd6e473
Refactor PostgresConnection to support SSL options
josephmancuso Oct 30, 2024
2e4c2fe
Merge pull request #905 from MasoniteFramework/feature/875-1
josephmancuso Oct 30, 2024
7e86c33
use passed in parameters
circulon Oct 30, 2024
97eaa57
fixed parameter name
circulon Oct 30, 2024
58edcde
renamed table variables
circulon Oct 30, 2024
8193bf3
fix nested relation
pbellerive Nov 11, 2024
93c7a38
Add Radon analysis workflow for cyclomatic complexity checks
josephmancuso Nov 20, 2024
54f561c
Enhance Radon analysis workflow to capture and output cyclomatic comp…
josephmancuso Nov 20, 2024
72e3347
Update Radon analysis workflow to save cyclomatic complexity output t…
josephmancuso Nov 20, 2024
29551f8
test
josephmancuso Nov 20, 2024
efc9567
Update Radon analysis workflow to set output using GitHub environment…
josephmancuso Nov 20, 2024
162fced
Update Radon analysis workflow to use set-output for environment vari…
josephmancuso Nov 20, 2024
e364693
Refactor Radon analysis workflow to streamline output handling and re…
josephmancuso Nov 20, 2024
fe5a784
Update Radon analysis workflow to set output using GitHub environment…
josephmancuso Nov 20, 2024
0d34132
Update Radon analysis workflow to enhance reporting and streamline co…
josephmancuso Nov 20, 2024
84b168e
Update Radon comment action to use version 0.1
josephmancuso Nov 20, 2024
a0534d8
Fix version tag for Radon comment action in workflow
josephmancuso Nov 20, 2024
c50c9dc
Add installation step for Radon in analysis workflow
josephmancuso Nov 20, 2024
49a2427
Update Radon analysis workflow to report on changed files only
josephmancuso Nov 20, 2024
12a2132
Update Radon analysis workflow to use the latest commit for reporting
josephmancuso Nov 20, 2024
c3e3ce7
Update Radon analysis workflow to use the correct base branch for rep…
josephmancuso Nov 20, 2024
6e716cd
Add test comment in __setitem__ method of Collection class
josephmancuso Nov 20, 2024
d4bd425
Fix Radon analysis workflow to use the correct branch reference for r…
josephmancuso Nov 20, 2024
a01f769
Update Radon analysis workflow to use the correct range for changed f…
josephmancuso Nov 20, 2024
86daadf
Handle empty file lists in Radon analysis workflow to prevent errors
josephmancuso Nov 20, 2024
f62592e
Refactor Radon analysis workflow to support both push and pull_reques…
josephmancuso Nov 20, 2024
07b3a0b
Simplify git fetch command in Radon analysis workflow to ensure full …
josephmancuso Nov 20, 2024
1f82378
Update Radon analysis workflow to use the correct base branch for cha…
josephmancuso Nov 21, 2024
af80dd2
Refactor Radon analysis workflow to trigger on pull requests and stre…
josephmancuso Nov 21, 2024
b28e152
Update Radon analysis workflow to trigger on pull requests for the 2.…
josephmancuso Nov 21, 2024
583a32f
Add Radon installation step to analysis workflow
josephmancuso Nov 21, 2024
97a853e
Add printing of Radon reports in analysis workflow
josephmancuso Nov 21, 2024
1742970
Enhance Radon analysis workflow to trigger on Python file changes and…
josephmancuso Nov 21, 2024
dc4a53d
Enhance Radon analysis workflow to fetch full git history and debug c…
josephmancuso Nov 21, 2024
3a97cb3
Refine Radon analysis workflow to improve environment variable handli…
josephmancuso Nov 21, 2024
59fd976
Add granular Radon analysis workflow for method-level change detection
josephmancuso Nov 21, 2024
85b0643
Refine Radon analysis workflow to accurately match methods with chang…
josephmancuso Nov 21, 2024
7657fa4
Refine Radon analysis workflow to capture raw output and improve meth…
josephmancuso Nov 21, 2024
a820a13
Remove granular Radon analysis workflow configuration
josephmancuso Nov 21, 2024
be07de7
wip
josephmancuso Nov 21, 2024
bb2317b
test
josephmancuso Nov 21, 2024
0fd0744
Remove commented test line and clean up migration command help text f…
josephmancuso Nov 21, 2024
c9055e9
Merge pull request #908 from MasoniteFramework/feature/radon
josephmancuso Nov 21, 2024
a844ce6
Merge branch 'fix/has_many_through_not_working' of https://github.com…
josephmancuso Nov 21, 2024
5da7c38
Merge pull request #903 from circulon/fix/has_many_through_not_working
josephmancuso Nov 21, 2024
7b3c2f1
Merge branch 'feature/906' of https://github.com/pbellerive/masonite_…
josephmancuso Nov 21, 2024
1d70063
Refactor relationship mapping in QueryBuilder and related classes
josephmancuso Nov 21, 2024
9a97947
Remove Radon analysis workflow from GitHub Actions
josephmancuso Nov 21, 2024
08a0dee
Add map_related method to HasMany relationship for grouping related r…
josephmancuso Nov 21, 2024
588e601
Add map_related method to BelongsTo relationship for grouping related…
josephmancuso Nov 21, 2024
a77d0b3
Add map_related method to HasOne and HasOneThrough relationships for …
josephmancuso Nov 21, 2024
4cc4ddc
Add map_related method to HasManyThrough relationship for grouping re…
josephmancuso Nov 21, 2024
6ae0ceb
linted
josephmancuso Nov 21, 2024
f906846
Fix missing newline at end of file in HasManyThrough relationship
josephmancuso Nov 21, 2024
fca57b0
Refactor map_related method in HasOne relationship to return related …
josephmancuso Nov 22, 2024
9c2964d
remove group by
pbellerive Nov 24, 2024
004ba6b
Merge branch 'feature/906' of https://github.com/pbellerive/masonite_…
josephmancuso Nov 28, 2024
954a63a
Merge pull request #907 from pbellerive/feature/906
josephmancuso Nov 28, 2024
ccf9025
Update setup.py
josephmancuso Nov 28, 2024
11743db
Fixed using model default select columns correctly
circulon Dec 1, 2024
e9008ae
Fixed and added tests
circulon Dec 1, 2024
3970262
Cleanup
circulon Dec 1, 2024
675dd1f
Merge pull request #912 from circulon/fix/allow_override_of_model_def…
josephmancuso Jan 22, 2025
44ec039
Update setup.py
josephmancuso Jan 22, 2025
6303b80
Added where_not_in to Collection
circulon Feb 13, 2025
153c6e2
Check if args are all string ints first
circulon Feb 13, 2025
c2d37d7
fixed attach not working for unsaved models
circulon Feb 14, 2025
3aed0d9
Merge pull request #918 from circulon/feature/collection_add_where_no…
josephmancuso Feb 14, 2025
5b3f7ad
moved eexception for not implemented methods to BaseRelationship
circulon Feb 15, 2025
6ceecdc
added methods previously in BaseRelationship back into required classes
circulon Feb 15, 2025
8b9f60c
sorted and black relationships
circulon Feb 15, 2025
f4d08e8
Fixed typo
circulon Feb 15, 2025
2b56578
aded attach/detach tests for HasOne and BelongsTo
circulon Feb 15, 2025
8157921
removed accidently duplicated method
circulon Feb 15, 2025
b10cc4f
removed redundant parameters
circulon Feb 15, 2025
ce75d40
Added some comments
circulon Feb 16, 2025
21ff105
Moved customisations to relationship classes
circulon Feb 16, 2025
c1881c7
changed nested pass logic in favour of fail early and readability
circulon Feb 16, 2025
afc8522
enabled testing of increment, decrement and truncate queries
circulon Feb 22, 2025
39af1c2
fixed raw QueryBuilder could not use .find methods
circulon Feb 23, 2025
0ebd140
added tests
circulon Feb 23, 2025
3643921
Fixed OFFSET with sqlite throwing syntax error
circulon Feb 23, 2025
78ebcdc
Merge pull request #930 from circulon/fix/929
josephmancuso Mar 24, 2025
6c189f0
Merge pull request #926 from circulon/fix/925
josephmancuso Mar 24, 2025
5282d49
Merge pull request #928 from circulon/fix/927
josephmancuso Mar 25, 2025
983ab32
Merge pull request #924 from circulon/fix/923
josephmancuso Mar 25, 2025
7e42fc3
Merge branch '2.0' of https://github.com/MasoniteFramework/orm into t…
circulon Mar 28, 2025
1843dea
fixed having location in query string
circulon Mar 28, 2025
016e742
Fixed increment and decrement not returning builder
circulon Mar 28, 2025
2edf3cb
setup pre-commit
circulon Mar 28, 2025
80aeb34
Cleanup
circulon Mar 28, 2025
2df05fa
fixed attach on update
circulon Mar 28, 2025
c2d6be6
fixed pre-commit install
circulon Mar 28, 2025
e4c8007
fixed CI workflows
circulon Mar 29, 2025
947138b
use pyproject settings
circulon Mar 29, 2025
16aad1a
fixed flak8 install
circulon Mar 29, 2025
97314c5
removed requirements.dev dependency
circulon Mar 29, 2025
2205cf9
removed broken test
circulon Mar 29, 2025
ca0cddc
Create and update default cast=True
circulon Mar 29, 2025
d7aee47
format
circulon Mar 29, 2025
b408ac2
Format & cleanup
circulon Mar 29, 2025
5a37e17
added tests to linting checks
circulon Mar 29, 2025
a71aba7
added tests to linting checks
circulon Mar 29, 2025
6172931
Merge branch 'feature/2.0_to_3.0' of https://github.com/circulon/orm …
circulon Mar 29, 2025
8aafcd8
updated cleo version requiremnts
circulon Mar 30, 2025
4970609
updated compatibility versions
circulon Mar 30, 2025
9fcd4d0
Moved Faker to a dev/testing dependency
circulon Mar 30, 2025
8249c22
moved psycopg2 driver check
circulon Mar 30, 2025
09b1e2e
added seeder group to include the faker package
circulon Mar 30, 2025
172f309
Added CHANGELOG
circulon Mar 31, 2025
26c1916
cleaned up casting
circulon Apr 1, 2025
2ca47d3
fixed bulk_create cast defaults to True
circulon Apr 7, 2025
df76f2a
only cast if a model is in use
circulon Apr 7, 2025
05c821b
removed non passthrough method name
circulon Apr 7, 2025
afafefd
aligned Model.pyi with Model and QueryBuilder
circulon Apr 7, 2025
c60865f
removed duplicate method definition
circulon Apr 7, 2025
3be65c7
reordered pre-commit tools
circulon Apr 11, 2025
b9ac7e0
Fixed Model autocompletes
circulon Apr 11, 2025
3cc2d51
Made selected config path decision easier to read
circulon Apr 15, 2025
bc431bc
Fixed some passthrough methods not hinted correctly
circulon May 5, 2025
a94de59
db
josephmancuso May 15, 2025
ab6a9a0
Added comments for clarity of purpose
circulon May 20, 2025
f2a064f
Fixed Decimal not casting correctly
circulon May 20, 2025
c304564
updated orm.sqlite3 for tests
circulon May 26, 2025
07547a0
added missing arguments
circulon May 29, 2025
18ee0f7
Merge branch 'feature/2.0_to_3.0' of https://github.com/circulon/orm …
josephmancuso Jun 11, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
use asdf
layout python
4 changes: 2 additions & 2 deletions .github/workflows/pythonapp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
make init
make init-ci
- name: Test with pytest
env:
POSTGRES_DATABASE_HOST: localhost
Expand Down Expand Up @@ -68,6 +68,6 @@ jobs:
python-version: 3.12
- name: Install Flake8
run: |
pip install flake8==3.7.9
pip install flake8-pyproject
- name: Lint
run: make lint
2 changes: 1 addition & 1 deletion .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
make init
make init-ci
- name: Test with Pytest and Publish to PYPI
env:
POSTGRES_DATABASE_HOST: localhost
Expand Down
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
venv
.direnv
.python-version
.vscode
.pytest_*
Expand All @@ -15,4 +16,7 @@ htmlcov/*
coverage.xml
.coverage
*.log
build
build
/orm.sqlite3
/.bootstrapped-pip
/.ignore-pre-commit
32 changes: 32 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
repos:
- repo: https://github.com/pycqa/isort
rev: 6.0.1
hooks:
- id: isort
args: [--profile=black]
exclude: |
(?x)(
^build|
^conda
)

- repo: https://github.com/psf/black
rev: 25.1.0
hooks:
- id: black
exclude: |
(?x)(
^build|
^conda
)

- repo: https://github.com/pycqa/flake8
rev: 7.1.2
hooks:
- id: flake8
additional_dependencies: [flake8-pyproject]
exclude: |
(?x)(
^build|
^conda
)
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python 3.8.10
53 changes: 53 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Change Log

## [3.0.0] - 2025-03-30

### Changed

- Model `create` now always checks for cast values
- `pendulum` version upgrade

#### Breaking Changes

- Changed raw expressions placeholder from requiringing explicit quoring per grammar (like this '?') to automaic (like this ?)
- Changed `update` and `delete` methods to return the affected rows instead of the model
- Seeding depencies are now in a separate`[seeder]` extension
- `Factory` class must now be imported from the sub-package `masoniteorm.factories`

### Fixed

- Model `update` and `delete` not casting passed values


## [2.24.0] - 2025-01-23

### Added

- allow override of model default selects

## [2.23.2] - 2024-11-29

## Added

- Ability so specify default select criteria for Models
- Add connection pooling to MySQL and Postgres
- PostgresConnection supports SSL and TLS options

## Fixed

- `.on_null` and `.on_not_null` had to be last criteria
- Find cannot use scopes
- Fix `has_one_through` relationship not working
- Tests parameter `query=True` should return query builder
- Fix `has_many_through` relationship not working
- Fixed nested relations

## [2.23.1] - 2024-10-22

Maintenance release

## [2.23.0] - 2024-10-19

## Added

- Updated tests
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ If you are interested in the project then it would be a great idea to read the "

## Issues

Everything really should start with opening an issue or finding an issue. If you feel you have an idea for how the project can be improved, no matter how small, you should open an issue so we can have an open dicussion with the maintainers of the project.
Everything really should start with opening an issue or finding an issue. If you feel you have an idea for how the project can be improved, no matter how small, you should open an issue so we can have an open discussion with the maintainers of the project.

We can discuss in that issue the solution to the problem or feature you have. If we do not feel it fits within the project then we will close the issue. Feel free to open a new issue if new information comes up.

Expand Down
9 changes: 6 additions & 3 deletions cc.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,22 @@
# print(builder.where("id", 1).or_where(lambda q: q.where('id', 2).or_where('id', 3)).get())

class User(Model):
__connection__ = "sqlite"
__connection__ = "t"
__table__ = "users"
__dates__ = ["verified_at"]

@has_many("id", "user_id")
def articles(self):
return Article
class Article(Model):
class Company(Model):
__connection__ = "sqlite"


# user = User.create({"name": "phill", "email": "phill"})
# print(inspect.isclass(User))
print(User.find(1).with_("articles").first().serialize())
user = User.first()
# user.update({"verified_at": None, "updated_at": None})
print(user.serialize())

# print(user.serialize())
# print(User.first())
35 changes: 35 additions & 0 deletions config/test-database.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
from src.masoniteorm.connections import ConnectionResolver

DATABASES = {
"default": "mysql",
"mysql": {
"host": "127.0.0.1",
"driver": "mysql",
"database": "masonite",
"user": "root",
"password": "",
"port": 3306,
"log_queries": False,
"options": {
#
}
},
"postgres": {
"host": "127.0.0.1",
"driver": "postgres",
"database": "masonite",
"user": "root",
"password": "",
"port": 5432,
"log_queries": False,
"options": {
#
}
},
"sqlite": {
"driver": "sqlite",
"database": "masonite.sqlite3",
}
}

DB = ConnectionResolver().set_connection_details(DATABASES)
44 changes: 29 additions & 15 deletions makefile
Original file line number Diff line number Diff line change
@@ -1,22 +1,36 @@
init:
cp .env-example .env
SHELL := /bin/bash

init: .env .bootstrapped-pip .git/hooks/pre-commit
init-ci:
touch .ignore-pre-commit
make init

.bootstrapped-pip: requirements.txt
pip install -r requirements.txt
pip install .
# Create MySQL Database
# Create Postgres Database
test:
touch .bootstrapped-pip

.git/hooks/pre-commit:
@if ! test -e ".ignore-pre-commit"; then \
pip install pre-commit; \
pre-commit install --install-hooks; \
fi

.env:
cp .env-example .env

# Create MySQL Database
# Create Postgres Database
test: init
python -m pytest tests
ci:
make test
check: format sort lint
lint:
python -m flake8 src/masoniteorm/ --ignore=E501,F401,E203,E128,E402,E731,F821,E712,W503,F811,E231,E702
format:
black src/masoniteorm
black tests/
make lint
sort:
isort tests
isort src/masoniteorm
flake8 src/masoniteorm tests
format: init
black src/masoniteorm tests/
sort: init
isort src/masoniteorm tests/
coverage:
python -m pytest --cov-report term --cov-report xml --cov=src/masoniteorm tests/
python -m coveralls
Expand All @@ -37,4 +51,4 @@ pub:
rm -fr build dist .egg masonite.egg-info
rm -rf dist/*
pypirc:
cp .pypirc ~/.pypirc
cp .pypirc ~/.pypirc
2 changes: 2 additions & 0 deletions orm
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ from src.masoniteorm.commands import (
MigrateCommand,
MigrateRollbackCommand,
MigrateRefreshCommand,
MigrateFreshCommand,
MakeMigrationCommand,
MakeObserverCommand,
MakeModelCommand,
Expand All @@ -25,6 +26,7 @@ application = Application("ORM Version:", 0.1)
application.add(MigrateCommand())
application.add(MigrateRollbackCommand())
application.add(MigrateRefreshCommand())
application.add(MigrateFreshCommand())
application.add(MakeMigrationCommand())
application.add(MakeModelCommand())
application.add(MakeModelDocstringCommand())
Expand Down
Binary file modified orm.sqlite3
Binary file not shown.
21 changes: 21 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[tool.black]
target-version = ['py38']
include = '\.pyi?$'
line-length = 79

[tool.isort]
profile = "black"
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
ensure_newline_before_comments = true

[tool.flake8]
ignore = ['E501', 'E203', 'E128', 'E402', 'E731', 'F821', 'E712', 'W503', 'F811']
#max-line-length = 79
#max-complexity = 18
per-file-ignores = [
'__init__.py:F401',
'setup.py:E266',
]
3 changes: 3 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[pytest]
env =
D:DB_CONFIG_PATH=config/test-database
12 changes: 6 additions & 6 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
flake8==3.7.9
black==19.3b0
flake8-pyproject
black
isort
faker
pytest
pytest-cov
pymysql
isort
inflection==0.3.1
inflection>=0.3
psycopg2-binary
python-dotenv==0.14.0
python-dotenv>=0.14
pyodbc
pendulum>=3.0,<4.0
cleo>=0.8.0,<0.9
cleo>=0.8.0,<2.0
13 changes: 7 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@
install_requires=[
"inflection>=0.3,<0.6",
"pendulum>=3.0,<4.0",
"faker>=4.1.0,<14.0",
"cleo>=0.8.0,<0.9",
"cleo>=0.8.0,<2.0",
],
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers
classifiers=[
Expand All @@ -50,10 +49,12 @@
"Operating System :: OS Independent",
# Specify the Python versions you support here. In particular, ensure
# that you indicate whether you support Python 2, Python 3 or both.
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Framework :: Masonite",
"Topic :: Software Development :: Libraries :: Python Modules",
"Framework :: Masonite",
Expand Down Expand Up @@ -83,15 +84,15 @@
"masoniteorm.schema.platforms",
"masoniteorm.scopes",
"masoniteorm.seeds",
"masoniteorm.testing",
],
# List additional groups of dependencies here (e.g. development
# dependencies). You can install these using the following syntax,
# for example:
# $ pip install -e .[dev,test]
# $ pip install your-package[dev,test]
extras_require={
"test": ["coverage", "pytest"],
"test": ["coverage", "pytest", "faker"],
"seeder": ["faker"],
},
# If there are data files included in your packages that need to be
# installed, specify them here. If using Python 2.6 or less, then these
Expand Down
1 change: 0 additions & 1 deletion src/masoniteorm/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
from .models import Model
from .factories.Factory import Factory
Loading