masonite-orm 2.23.2__tar.gz → 3.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- masonite_orm-3.0.0/.deepsource.toml +15 -0
- masonite_orm-3.0.0/.env-example +16 -0
- masonite_orm-3.0.0/.github/ISSUE_TEMPLATE/bug_report.md +35 -0
- masonite_orm-3.0.0/.github/ISSUE_TEMPLATE/feature_request.md +19 -0
- masonite_orm-3.0.0/.github/workflows/pythonapp.yml +73 -0
- masonite_orm-3.0.0/.github/workflows/pythonpublish.yml +80 -0
- masonite_orm-3.0.0/.gitignore +18 -0
- masonite_orm-3.0.0/.pypirc +8 -0
- masonite_orm-3.0.0/CONTRIBUTING.md +66 -0
- masonite_orm-3.0.0/LICENSE +21 -0
- masonite_orm-3.0.0/PKG-INFO +60 -0
- masonite_orm-3.0.0/TODO.md +10 -0
- masonite_orm-3.0.0/app/observers/UserObserver.py +101 -0
- masonite_orm-3.0.0/cc.py +34 -0
- masonite_orm-3.0.0/conda/conda_build_config.yaml +5 -0
- masonite_orm-3.0.0/conda/meta.yaml +28 -0
- masonite_orm-3.0.0/databases/migrations/2018_01_09_043202_create_users_table.py +28 -0
- masonite_orm-3.0.0/databases/migrations/2020_04_17_000000_create_friends_table.py +19 -0
- masonite_orm-3.0.0/databases/migrations/2020_04_17_00000_create_articles_table.py +18 -0
- masonite_orm-3.0.0/databases/migrations/2020_10_20_152904_create_table_schema_migration.py +21 -0
- masonite_orm-3.0.0/databases/migrations/__init__.py +3 -0
- masonite_orm-3.0.0/databases/seeds/database_seeder.py +10 -0
- masonite_orm-3.0.0/databases/seeds/user_table_seeder.py +16 -0
- masonite_orm-3.0.0/makefile +40 -0
- masonite_orm-3.0.0/orm +39 -0
- masonite_orm-3.0.0/orm.sqlite3 +0 -0
- masonite_orm-3.0.0/requirements.txt +13 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/setup.py +2 -2
- masonite_orm-3.0.0/src/masonite_orm.egg-info/PKG-INFO +60 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masonite_orm.egg-info/SOURCES.txt +102 -2
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masonite_orm.egg-info/entry_points.txt +0 -1
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masonite_orm.egg-info/requires.txt +1 -1
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/collection/Collection.py +9 -33
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/commands/Entry.py +0 -2
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/commands/MigrateRefreshCommand.py +3 -2
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/commands/MigrateStatusCommand.py +4 -15
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/commands/SeedRunCommand.py +1 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/commands/__init__.py +0 -1
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/config.py +2 -6
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/connections/BaseConnection.py +3 -8
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/connections/ConnectionFactory.py +4 -5
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/connections/ConnectionResolver.py +4 -3
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/connections/MSSQLConnection.py +2 -4
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/connections/MySQLConnection.py +28 -85
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/connections/PostgresConnection.py +14 -75
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/connections/SQLiteConnection.py +0 -4
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/exceptions.py +0 -4
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/factories/Factory.py +1 -0
- masonite_orm-3.0.0/src/masoniteorm/helpers/__init__.py +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/migrations/Migration.py +7 -43
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/models/MigrationModel.py +1 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/models/Model.py +160 -261
- masonite_orm-3.0.0/src/masoniteorm/models/Model.pyi +782 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/observers/ObservesEvents.py +1 -1
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/query/QueryBuilder.py +136 -190
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/query/grammars/BaseGrammar.py +33 -18
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/query/grammars/MSSQLGrammar.py +5 -7
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/query/grammars/MySQLGrammar.py +5 -4
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/query/grammars/PostgresGrammar.py +5 -4
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/query/grammars/SQLiteGrammar.py +5 -4
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/relationships/BaseRelationship.py +2 -5
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/relationships/BelongsTo.py +5 -6
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/relationships/BelongsToMany.py +6 -6
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/relationships/HasMany.py +1 -4
- masonite_orm-3.0.0/src/masoniteorm/relationships/HasManyThrough.py +203 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/relationships/HasOne.py +1 -4
- masonite_orm-3.0.0/src/masoniteorm/relationships/HasOneThrough.py +203 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/relationships/MorphOne.py +3 -3
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/relationships/MorphTo.py +1 -4
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/schema/Blueprint.py +7 -47
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/schema/Column.py +0 -20
- masonite_orm-3.0.0/src/masoniteorm/schema/ColumnDiff.py +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/schema/Schema.py +2 -18
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/schema/Table.py +0 -2
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/schema/platforms/MSSQLPlatform.py +2 -4
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/schema/platforms/MySQLPlatform.py +4 -22
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/schema/platforms/Platform.py +1 -2
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/schema/platforms/PostgresPlatform.py +3 -19
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/schema/platforms/SQLitePlatform.py +5 -32
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/scopes/SoftDeleteScope.py +2 -4
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/scopes/TimeStampsScope.py +5 -9
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/scopes/UUIDPrimaryKeyScope.py +9 -19
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/scopes/scope.py +1 -4
- masonite_orm-3.0.0/src/masoniteorm/stubs/create-migration.html +13 -0
- masonite_orm-3.0.0/src/masoniteorm/stubs/table-migration.html +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/testing/BaseTestCaseSelectGrammar.py +2 -16
- masonite_orm-3.0.0/tests/User.py +17 -0
- masonite_orm-3.0.0/tests/collection/test_collection.py +662 -0
- masonite_orm-3.0.0/tests/commands/test_shell.py +89 -0
- masonite_orm-3.0.0/tests/config/test_db_url.py +125 -0
- masonite_orm-3.0.0/tests/connections/test_base_connections.py +30 -0
- masonite_orm-3.0.0/tests/eagers/test_eager.py +73 -0
- masonite_orm-3.0.0/tests/factories/test_factories.py +68 -0
- masonite_orm-3.0.0/tests/integrations/config/__init__.py +0 -0
- masonite_orm-3.0.0/tests/integrations/config/database.py +143 -0
- masonite_orm-3.0.0/tests/models/test_models.py +197 -0
- masonite_orm-3.0.0/tests/mssql/builder/test_mssql_query_builder.py +413 -0
- masonite_orm-3.0.0/tests/mssql/builder/test_mssql_query_builder_relationships.py +105 -0
- masonite_orm-3.0.0/tests/mssql/grammar/test_mssql_delete_grammar.py +29 -0
- masonite_orm-3.0.0/tests/mssql/grammar/test_mssql_insert_grammar.py +32 -0
- masonite_orm-3.0.0/tests/mssql/grammar/test_mssql_qmark.py +42 -0
- masonite_orm-3.0.0/tests/mssql/grammar/test_mssql_select_grammar.py +471 -0
- masonite_orm-3.0.0/tests/mssql/grammar/test_mssql_update_grammar.py +36 -0
- masonite_orm-3.0.0/tests/mssql/schema/test_mssql_schema_builder.py +282 -0
- masonite_orm-3.0.0/tests/mssql/schema/test_mssql_schema_builder_alter.py +271 -0
- masonite_orm-3.0.0/tests/mysql/builder/test_mysql_builder_transaction.py +45 -0
- masonite_orm-3.0.0/tests/mysql/builder/test_query_builder.py +919 -0
- masonite_orm-3.0.0/tests/mysql/builder/test_query_builder_scopes.py +69 -0
- masonite_orm-3.0.0/tests/mysql/builder/test_transactions.py +36 -0
- masonite_orm-3.0.0/tests/mysql/connections/test_mysql_connection_selects.py +47 -0
- masonite_orm-3.0.0/tests/mysql/grammar/test_mysql_delete_grammar.py +80 -0
- masonite_orm-3.0.0/tests/mysql/grammar/test_mysql_insert_grammar.py +98 -0
- masonite_orm-3.0.0/tests/mysql/grammar/test_mysql_qmark.py +206 -0
- masonite_orm-3.0.0/tests/mysql/grammar/test_mysql_select_grammar.py +461 -0
- masonite_orm-3.0.0/tests/mysql/grammar/test_mysql_update_grammar.py +116 -0
- masonite_orm-3.0.0/tests/mysql/model/test_accessors_and_mutators.py +47 -0
- masonite_orm-3.0.0/tests/mysql/model/test_model.py +235 -0
- masonite_orm-3.0.0/tests/mysql/relationships/test_belongs_to_many.py +174 -0
- masonite_orm-3.0.0/tests/mysql/relationships/test_has_many_through.py +98 -0
- masonite_orm-3.0.0/tests/mysql/relationships/test_has_one_through.py +98 -0
- masonite_orm-3.0.0/tests/mysql/relationships/test_relationships.py +185 -0
- masonite_orm-3.0.0/tests/mysql/schema/test_mysql_schema_builder.py +364 -0
- masonite_orm-3.0.0/tests/mysql/schema/test_mysql_schema_builder_alter.py +297 -0
- masonite_orm-3.0.0/tests/mysql/scopes/test_can_use_global_scopes.py +43 -0
- masonite_orm-3.0.0/tests/mysql/scopes/test_can_use_scopes.py +40 -0
- masonite_orm-3.0.0/tests/mysql/scopes/test_soft_delete.py +75 -0
- masonite_orm-3.0.0/tests/postgres/builder/test_postgres_query_builder.py +774 -0
- masonite_orm-3.0.0/tests/postgres/builder/test_postgres_transaction.py +42 -0
- masonite_orm-3.0.0/tests/postgres/grammar/test_delete_grammar.py +78 -0
- masonite_orm-3.0.0/tests/postgres/grammar/test_insert_grammar.py +77 -0
- masonite_orm-3.0.0/tests/postgres/grammar/test_select_grammar.py +476 -0
- masonite_orm-3.0.0/tests/postgres/grammar/test_update_grammar.py +119 -0
- masonite_orm-3.0.0/tests/postgres/relationships/test_postgres_relationships.py +132 -0
- masonite_orm-3.0.0/tests/postgres/schema/test_postgres_schema_builder.py +351 -0
- masonite_orm-3.0.0/tests/postgres/schema/test_postgres_schema_builder_alter.py +304 -0
- masonite_orm-3.0.0/tests/scopes/test_default_global_scopes.py +115 -0
- masonite_orm-3.0.0/tests/seeds/test_seeds.py +12 -0
- masonite_orm-3.0.0/tests/sqlite/builder/test_sqlite_builder_insert.py +40 -0
- masonite_orm-3.0.0/tests/sqlite/builder/test_sqlite_builder_pagination.py +67 -0
- masonite_orm-3.0.0/tests/sqlite/builder/test_sqlite_query_builder.py +973 -0
- masonite_orm-3.0.0/tests/sqlite/builder/test_sqlite_query_builder_eager_loading.py +100 -0
- masonite_orm-3.0.0/tests/sqlite/builder/test_sqlite_query_builder_relationships.py +130 -0
- masonite_orm-3.0.0/tests/sqlite/builder/test_sqlite_transaction.py +53 -0
- masonite_orm-3.0.0/tests/sqlite/grammar/test_sqlite_delete_grammar.py +76 -0
- masonite_orm-3.0.0/tests/sqlite/grammar/test_sqlite_insert_grammar.py +98 -0
- masonite_orm-3.0.0/tests/sqlite/grammar/test_sqlite_select_grammar.py +458 -0
- masonite_orm-3.0.0/tests/sqlite/grammar/test_sqlite_update_grammar.py +114 -0
- masonite_orm-3.0.0/tests/sqlite/models/test_observers.py +123 -0
- masonite_orm-3.0.0/tests/sqlite/models/test_sqlite_model.py +249 -0
- masonite_orm-3.0.0/tests/sqlite/relationships/test_sqlite_polymorphic.py +58 -0
- masonite_orm-3.0.0/tests/sqlite/relationships/test_sqlite_relationships.py +171 -0
- masonite_orm-3.0.0/tests/sqlite/schema/test_sqlite_schema_builder.py +338 -0
- masonite_orm-3.0.0/tests/sqlite/schema/test_sqlite_schema_builder_alter.py +211 -0
- masonite_orm-3.0.0/tests/sqlite/schema/test_table.py +110 -0
- masonite_orm-3.0.0/tests/sqlite/schema/test_table_diff.py +163 -0
- masonite_orm-3.0.0/tests/utils.py +57 -0
- masonite-orm-2.23.2/PKG-INFO +0 -54
- masonite-orm-2.23.2/src/masonite_orm.egg-info/PKG-INFO +0 -54
- masonite-orm-2.23.2/src/masoniteorm/commands/MigrateFreshCommand.py +0 -42
- masonite-orm-2.23.2/src/masoniteorm/relationships/HasManyThrough.py +0 -270
- masonite-orm-2.23.2/src/masoniteorm/relationships/HasOneThrough.py +0 -275
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/MANIFEST.in +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/README.md +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/setup.cfg +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masonite_orm.egg-info/dependency_links.txt +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masonite_orm.egg-info/top_level.txt +0 -0
- /masonite-orm-2.23.2/src/masoniteorm/helpers/__init__.py → /masonite_orm-3.0.0/src/masoniteorm/.gitignore +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/__init__.py +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/collection/__init__.py +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/commands/CanOverrideConfig.py +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/commands/CanOverrideOptionsDefault.py +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/commands/Command.py +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/commands/MakeMigrationCommand.py +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/commands/MakeModelCommand.py +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/commands/MakeModelDocstringCommand.py +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/commands/MakeObserverCommand.py +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/commands/MakeSeedCommand.py +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/commands/MigrateCommand.py +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/commands/MigrateResetCommand.py +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/commands/MigrateRollbackCommand.py +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/commands/ShellCommand.py +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/commands/stubs/create_migration.stub +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/commands/stubs/create_seed.stub +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/commands/stubs/model.stub +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/commands/stubs/observer.stub +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/commands/stubs/table_migration.stub +0 -0
- /masonite-orm-2.23.2/src/masoniteorm/schema/ColumnDiff.py → /masonite_orm-3.0.0/src/masoniteorm/connections/.gitignore +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/connections/__init__.py +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/expressions/__init__.py +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/expressions/expressions.py +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/factories/__init__.py +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/helpers/misc.py +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/migrations/__init__.py +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/models/Pivot.py +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/models/__init__.py +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/observers/__init__.py +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/pagination/BasePaginator.py +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/pagination/LengthAwarePaginator.py +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/pagination/SimplePaginator.py +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/pagination/__init__.py +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/providers/ORMProvider.py +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/providers/__init__.py +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/query/EagerRelation.py +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/query/__init__.py +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/query/grammars/__init__.py +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/query/processors/MSSQLPostProcessor.py +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/query/processors/MySQLPostProcessor.py +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/query/processors/PostgresPostProcessor.py +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/query/processors/SQLitePostProcessor.py +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/query/processors/__init__.py +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/relationships/MorphMany.py +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/relationships/MorphToMany.py +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/relationships/__init__.py +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/schema/Constraint.py +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/schema/ForeignKeyConstraint.py +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/schema/Index.py +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/schema/TableDiff.py +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/schema/__init__.py +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/schema/platforms/__init__.py +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/scopes/BaseScope.py +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/scopes/SoftDeletesMixin.py +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/scopes/TimeStampsMixin.py +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/scopes/UUIDPrimaryKeyMixin.py +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/scopes/__init__.py +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/seeds/Seeder.py +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/seeds/__init__.py +0 -0
- {masonite-orm-2.23.2 → masonite_orm-3.0.0}/src/masoniteorm/testing/__init__.py +0 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
|
|
2
|
+
RUN_MYSQL_DATABASE=False
|
|
3
|
+
|
|
4
|
+
MYSQL_DATABASE_HOST=
|
|
5
|
+
MYSQL_DATABASE_USER=
|
|
6
|
+
MYSQL_DATABASE_PASSWORD=
|
|
7
|
+
MYSQL_DATABASE_DATABASE=
|
|
8
|
+
MYSQL_DATABASE_PORT=
|
|
9
|
+
|
|
10
|
+
POSTGRES_DATABASE_HOST=
|
|
11
|
+
POSTGRES_DATABASE_USER=
|
|
12
|
+
POSTGRES_DATABASE_PASSWORD=
|
|
13
|
+
POSTGRES_DATABASE_DATABASE=
|
|
14
|
+
POSTGRES_DATABASE_PORT=
|
|
15
|
+
|
|
16
|
+
DATABASE_URL=
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug report
|
|
3
|
+
about: A bug would be defined as an issue / problem in the original requirement. If the feature works but could be enhanced please use the feature request option.
|
|
4
|
+
title: ''
|
|
5
|
+
labels: 'bug'
|
|
6
|
+
assignees: ''
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
**Describe the bug**
|
|
10
|
+
A clear and concise description of what the bug is.
|
|
11
|
+
|
|
12
|
+
**To Reproduce**
|
|
13
|
+
Steps to reproduce the behavior:
|
|
14
|
+
1. Go to '...'
|
|
15
|
+
2. Click on '....'
|
|
16
|
+
3. Scroll down to '....'
|
|
17
|
+
4. See error
|
|
18
|
+
|
|
19
|
+
**Expected behavior**
|
|
20
|
+
What do you believe should be happening?
|
|
21
|
+
|
|
22
|
+
**Screenshots or code snippets**
|
|
23
|
+
Screenshots help a lot. If applicable, add screenshots to help explain your problem.
|
|
24
|
+
|
|
25
|
+
**Desktop (please complete the following information):**
|
|
26
|
+
- OS: [e.g. Mac OSX, Windows]
|
|
27
|
+
- Version [e.g. Big Sur, 10]
|
|
28
|
+
|
|
29
|
+
**What database are you using?**
|
|
30
|
+
- Type: [e.g. Postgres, MySQL, SQLite]
|
|
31
|
+
- Version [e.g. 8, 9.1, 10.5]
|
|
32
|
+
- Masonite ORM [e.g. v1.0.26, v1.0.27]
|
|
33
|
+
|
|
34
|
+
**Additional context**
|
|
35
|
+
Any other steps you are doing or any other related information that will help us debug the problem please put here.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Feature request or enhancement
|
|
3
|
+
about: Suggest an idea or improvement for this project.
|
|
4
|
+
title: ''
|
|
5
|
+
labels: enhancement, feature request
|
|
6
|
+
assignees: ''
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
**Describe the feature as you'd like to see it**
|
|
11
|
+
A clear and concise description of what you want to happen.
|
|
12
|
+
|
|
13
|
+
**What do we currently have to do now?**
|
|
14
|
+
Give some examples or code snippets on the current way of doing things.
|
|
15
|
+
|
|
16
|
+
**Additional context**
|
|
17
|
+
Add any other context or screenshots about the feature request here.
|
|
18
|
+
|
|
19
|
+
- [ ] Is this a breaking change?
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
name: Test Application
|
|
2
|
+
|
|
3
|
+
on: [push, pull_request]
|
|
4
|
+
|
|
5
|
+
jobs:
|
|
6
|
+
build:
|
|
7
|
+
runs-on: ubuntu-latest
|
|
8
|
+
|
|
9
|
+
services:
|
|
10
|
+
postgres:
|
|
11
|
+
image: postgres:10.8
|
|
12
|
+
env:
|
|
13
|
+
POSTGRES_USER: postgres
|
|
14
|
+
POSTGRES_PASSWORD: postgres
|
|
15
|
+
POSTGRES_DB: postgres
|
|
16
|
+
ports:
|
|
17
|
+
# will assign a random free host port
|
|
18
|
+
- 5432/tcp
|
|
19
|
+
# needed because the postgres container does not provide a healthcheck
|
|
20
|
+
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
|
21
|
+
|
|
22
|
+
mysql:
|
|
23
|
+
image: mysql:5.7
|
|
24
|
+
env:
|
|
25
|
+
MYSQL_ALLOW_EMPTY_PASSWORD: yes
|
|
26
|
+
MYSQL_DATABASE: orm
|
|
27
|
+
ports:
|
|
28
|
+
- 3306
|
|
29
|
+
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
|
|
30
|
+
|
|
31
|
+
strategy:
|
|
32
|
+
matrix:
|
|
33
|
+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
|
|
34
|
+
name: Python ${{ matrix.python-version }}
|
|
35
|
+
steps:
|
|
36
|
+
- uses: actions/checkout@v3
|
|
37
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
38
|
+
uses: actions/setup-python@v3
|
|
39
|
+
with:
|
|
40
|
+
python-version: ${{ matrix.python-version }}
|
|
41
|
+
- name: Install dependencies
|
|
42
|
+
run: |
|
|
43
|
+
make init
|
|
44
|
+
- name: Test with pytest
|
|
45
|
+
env:
|
|
46
|
+
POSTGRES_DATABASE_HOST: localhost
|
|
47
|
+
POSTGRES_DATABASE_DATABASE: postgres
|
|
48
|
+
POSTGRES_DATABASE_USER: postgres
|
|
49
|
+
POSTGRES_DATABASE_PASSWORD: postgres
|
|
50
|
+
POSTGRES_DATABASE_PORT: ${{ job.services.postgres.ports[5432] }}
|
|
51
|
+
MYSQL_DATABASE_HOST: localhost
|
|
52
|
+
MYSQL_DATABASE_DATABASE: orm
|
|
53
|
+
MYSQL_DATABASE_USER: root
|
|
54
|
+
MYSQL_DATABASE_PORT: ${{ job.services.mysql.ports[3306] }}
|
|
55
|
+
DB_CONFIG_PATH: tests/integrations/config/database.py
|
|
56
|
+
run: |
|
|
57
|
+
python orm migrate --connection postgres
|
|
58
|
+
python orm migrate --connection mysql
|
|
59
|
+
make test
|
|
60
|
+
lint:
|
|
61
|
+
runs-on: ubuntu-latest
|
|
62
|
+
name: Lint
|
|
63
|
+
steps:
|
|
64
|
+
- uses: actions/checkout@v3
|
|
65
|
+
- name: Set up Python 3.6
|
|
66
|
+
uses: actions/setup-python@v3
|
|
67
|
+
with:
|
|
68
|
+
python-version: 3.12
|
|
69
|
+
- name: Install Flake8
|
|
70
|
+
run: |
|
|
71
|
+
pip install flake8==3.7.9
|
|
72
|
+
- name: Lint
|
|
73
|
+
run: make lint
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
name: Upload Python Package
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [created]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
build:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
|
|
11
|
+
services:
|
|
12
|
+
postgres:
|
|
13
|
+
image: postgres:10.8
|
|
14
|
+
env:
|
|
15
|
+
POSTGRES_USER: postgres
|
|
16
|
+
POSTGRES_PASSWORD: postgres
|
|
17
|
+
POSTGRES_DB: postgres
|
|
18
|
+
ports:
|
|
19
|
+
# will assign a random free host port
|
|
20
|
+
- 5432/tcp
|
|
21
|
+
# needed because the postgres container does not provide a healthcheck
|
|
22
|
+
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
|
23
|
+
|
|
24
|
+
mysql:
|
|
25
|
+
image: mysql:5.7
|
|
26
|
+
env:
|
|
27
|
+
MYSQL_ALLOW_EMPTY_PASSWORD: yes
|
|
28
|
+
MYSQL_DATABASE: orm
|
|
29
|
+
ports:
|
|
30
|
+
- 3306
|
|
31
|
+
options: --health-cmd="mysqladmin ping" --health-interval=10s --health-timeout=5s --health-retries=3
|
|
32
|
+
|
|
33
|
+
strategy:
|
|
34
|
+
matrix:
|
|
35
|
+
python-version: ["3.12"]
|
|
36
|
+
name: Python ${{ matrix.python-version }}
|
|
37
|
+
steps:
|
|
38
|
+
- uses: actions/checkout@v3
|
|
39
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
40
|
+
uses: actions/setup-python@v3
|
|
41
|
+
with:
|
|
42
|
+
python-version: ${{ matrix.python-version }}
|
|
43
|
+
- name: Install dependencies
|
|
44
|
+
run: |
|
|
45
|
+
make init
|
|
46
|
+
- name: Test with Pytest and Publish to PYPI
|
|
47
|
+
env:
|
|
48
|
+
POSTGRES_DATABASE_HOST: localhost
|
|
49
|
+
POSTGRES_DATABASE_DATABASE: postgres
|
|
50
|
+
POSTGRES_DATABASE_USER: postgres
|
|
51
|
+
POSTGRES_DATABASE_PASSWORD: postgres
|
|
52
|
+
POSTGRES_DATABASE_PORT: ${{ job.services.postgres.ports[5432] }}
|
|
53
|
+
MYSQL_DATABASE_HOST: localhost
|
|
54
|
+
MYSQL_DATABASE_DATABASE: orm
|
|
55
|
+
MYSQL_DATABASE_USER: root
|
|
56
|
+
MYSQL_DATABASE_PORT: ${{ job.services.mysql.ports[3306] }}
|
|
57
|
+
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
|
|
58
|
+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
|
|
59
|
+
DB_CONFIG_PATH: tests/integrations/config/database.py
|
|
60
|
+
run: |
|
|
61
|
+
python orm migrate --connection postgres
|
|
62
|
+
python orm migrate --connection mysql
|
|
63
|
+
make publish
|
|
64
|
+
- name: Discord notification
|
|
65
|
+
env:
|
|
66
|
+
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
|
67
|
+
uses: Ilshidur/action-discord@master
|
|
68
|
+
with:
|
|
69
|
+
args: "{{ EVENT_PAYLOAD.repository.full_name }} {{ EVENT_PAYLOAD.release.tag_name }} has been released. Checkout the full release notes here: {{ EVENT_PAYLOAD.release.html_url }}"
|
|
70
|
+
|
|
71
|
+
publish:
|
|
72
|
+
runs-on: ubuntu-latest
|
|
73
|
+
steps:
|
|
74
|
+
- uses: actions/checkout@v2
|
|
75
|
+
- name: publish-to-conda
|
|
76
|
+
uses: fcakyon/conda-publish-action@v1.3
|
|
77
|
+
with:
|
|
78
|
+
subdir: "conda"
|
|
79
|
+
anacondatoken: ${{ secrets.ANACONDA_TOKEN }}
|
|
80
|
+
platforms: "win osx linux"
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# Contributing Guide
|
|
2
|
+
|
|
3
|
+
This guide is intended to explain how to contribute to this project.
|
|
4
|
+
|
|
5
|
+
## Preface
|
|
6
|
+
|
|
7
|
+
Note that you do not need to write code in order to contribute to the project. You can contribute your voice, your ideas, past experiences or just join general discussions we are having in GitHub or the Slack channel. Whether its 1 hour per day or 1 minute per week. All input and ideas are important for the success of the project. That one sentence could lead to more discussion and ideas.
|
|
8
|
+
|
|
9
|
+
If you have any questions at all then be sure to join the [Slack Channel](https://slack.masoniteproject.com).
|
|
10
|
+
|
|
11
|
+
If you are interested in the project then it would be a great idea to read the "White Paper". This is a document about how the project works and how the classes all work together. The White Paper can be [Found Here](https://orm.masoniteproject.com/white-page)
|
|
12
|
+
|
|
13
|
+
## Issues
|
|
14
|
+
|
|
15
|
+
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.
|
|
16
|
+
|
|
17
|
+
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.
|
|
18
|
+
|
|
19
|
+
If there is already an issue open that you want to contribute ideas to, have information to add to the discussion, or want to contribute to the issue by writing code to complete the issue then please comment on the issue saying you would like to contribute to it.
|
|
20
|
+
|
|
21
|
+
## Labels
|
|
22
|
+
|
|
23
|
+
To improve the quality of issues, please add any related labels to the issue you think are most relevant. You may add as many as you think make sense. There are tag descriptions on the labels section of the repo so please read those descriptions to choose which labels best work for the issue.
|
|
24
|
+
|
|
25
|
+
**Please do not use any of the difficulty labels (easy, medium or hard). A maintainer will label the issue with the difficulty level after reviewing the issue**
|
|
26
|
+
|
|
27
|
+
## Difficulty Levels
|
|
28
|
+
|
|
29
|
+
Before contributing, it is assumed you have basic Python or programming skills and you are able to understand the issues enough to have a discussion about it without much information direction. All issues are marked with a difficulty level to determine how much effort will be involved in closing the issue. There are several difficulty level issues:
|
|
30
|
+
|
|
31
|
+
**good first issue** - Issues marked with this label are great issues to take if you have never contributed to open source before. These issues typically have a step by step solution in the issues are are intended for first time contributors to expand the pool of maintainers.
|
|
32
|
+
|
|
33
|
+
**easy** - Issues marked as easy are great issues to take if you have never contributed to this project before. Take this opportunity to take a simple issue to understand how some of the code works together and a simple test.
|
|
34
|
+
|
|
35
|
+
**medium** - Issues marked with this should not be worked on by someone who has not contributed to the project before. These issues assume you have basic knowledge of the codebase and can work on the issue with little direction. Discussions should be had on these issues on the best way to solve and close them.
|
|
36
|
+
|
|
37
|
+
**hard** - These issues should really not be worked on unless you are a maintainer of the Masonite organization. These issues are very involved and assume advanced knowledge of the codebase. You may contribute your voice to the issue but it is not advised you work on these issues unless you are a maintainer or have contributed to the past and have completed a medium difficulty task
|
|
38
|
+
|
|
39
|
+
## Pull Request Flow
|
|
40
|
+
|
|
41
|
+
If you choose to contribute to an issue via code contribution then please follow the steps below:
|
|
42
|
+
|
|
43
|
+
* First you will need to fork the repository. You can do this directly in GitHub by clicking the fork icon in the top right corner of the repository.
|
|
44
|
+
* You should then checkout the repository to your computer
|
|
45
|
+
* Make the code change and push up your changes to a local branch.
|
|
46
|
+
* **The branch should should follow a common naming convention. If the issue is #123 then your branch should be called `feature/123`. This helps me identify which issue the branch is supposed to fix.**
|
|
47
|
+
* You should then open a pull request to the repository.
|
|
48
|
+
* **All tests are required to be written before merging a pull request.** If you do not know how to write tests you can open the pull request without tests and we can discuss the best way to test the code you wrote. A maintainer or contributor could also step in and write tests for you
|
|
49
|
+
|
|
50
|
+
Once the pull request is open, the code will be reviewed and we will discuss how this particular solution to the problem solves the original issue. If there are code improvements or corrections to be made then they will be discussed with maintainers of the project.
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
## Running Tests
|
|
55
|
+
|
|
56
|
+
You should run all tests locally and make sure they pass before writing any code. This way you can be sure if your code is not breaking any tests that may be failing for other reasons.
|
|
57
|
+
|
|
58
|
+
You should set up a virtual environment and run tests via pytest:
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
$ python -m venv venv
|
|
62
|
+
$ source venv/bin/activate
|
|
63
|
+
$ python -m pytest
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
This should run all tests successfully. The code was written in a way where you do not need a database to test the code so all tests should run fine.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020 Joseph Mancuso
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: masonite-orm
|
|
3
|
+
Version: 3.0.0
|
|
4
|
+
Summary: The Official Masonite ORM
|
|
5
|
+
Home-page: https://github.com/masoniteframework/orm
|
|
6
|
+
Author: Joe Mancuso
|
|
7
|
+
Author-email: joe@masoniteproject.com
|
|
8
|
+
License: MIT
|
|
9
|
+
Keywords: Masonite,MasoniteFramework,Python,ORM
|
|
10
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Topic :: Software Development :: Build Tools
|
|
13
|
+
Classifier: Environment :: Web Environment
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Operating System :: OS Independent
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.6
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.7
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
20
|
+
Classifier: Framework :: Masonite
|
|
21
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
22
|
+
Classifier: Framework :: Masonite
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
License-File: LICENSE
|
|
25
|
+
Requires-Dist: inflection<0.6,>=0.3
|
|
26
|
+
Requires-Dist: pendulum<4.0,>=3.0
|
|
27
|
+
Requires-Dist: faker<14.0,>=4.1.0
|
|
28
|
+
Requires-Dist: cleo<0.9,>=0.8.0
|
|
29
|
+
Provides-Extra: test
|
|
30
|
+
Requires-Dist: coverage; extra == "test"
|
|
31
|
+
Requires-Dist: pytest; extra == "test"
|
|
32
|
+
|
|
33
|
+
<p align="center">
|
|
34
|
+
<img src="https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4trhpkkdbbzutc5ufxi9.png" width="160px">
|
|
35
|
+
<h1 align="center">Masonite ORM</h1>
|
|
36
|
+
</p>
|
|
37
|
+
|
|
38
|
+
<p align="center">
|
|
39
|
+
<a href="https://docs.masoniteproject.com">
|
|
40
|
+
<img alt="Masonite Package" src="https://img.shields.io/static/v1?label=Masonite&message=package&labelColor=grey&color=blue&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAYAAAAfSC3RAAAAAXNSR0IArs4c6QAAAIRlWElmTU0AKgAAAAgABQESAAMAAAABAAEAAAEaAAUAAAABAAAASgEbAAUAAAABAAAAUgEoAAMAAAABAAIAAIdpAAQAAAABAAAAWgAAAAAAAABIAAAAAQAAAEgAAAABAAOgAQADAAAAAQABAACgAgAEAAAAAQAAAA6gAwAEAAAAAQAAAA4AAAAATspU+QAAAAlwSFlzAAALEwAACxMBAJqcGAAAAVlpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDUuNC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6dGlmZj0iaHR0cDovL25zLmFkb2JlLmNvbS90aWZmLzEuMC8iPgogICAgICAgICA8dGlmZjpPcmllbnRhdGlvbj4xPC90aWZmOk9yaWVudGF0aW9uPgogICAgICA8L3JkZjpEZXNjcmlwdGlvbj4KICAgPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KTMInWQAAAnxJREFUKBVNUl1IVEEUPjPObdd1VdxWM0rMIl3bzbVWLSofVm3th0AhMakHHyqRiNSHEAq5b2HSVvoQRUiEECQUQkkPbRslRGigG8auoon2oPSjpev+3PWeZq7eaC5nDt93vplz5txDQJYpNxX4st4JFiwj9aCqmswUFQNS/A2YskrZJPYefkECC2GhQwAqvLYybwXrwBvq8HSNOXRO92+aH7nW8vc/wS2Z9TqneYt2KHjlf9Iv+43wFJMExzO0YE5OKe60N+AOW6OmE+WJTBrg23jjzWxMBauOlfyycsV24F+cH+zAXYUOGl+DaiDxfl245/W9OnVrSY+O2eqPkyz4sVvHoKp9gOihf5KoAVv3hkQgbj/ihG9fI3RixKcUVx7lJVaEc0vnyf2FFll+ny80ZHZiGhIKowWJBCEAKr+FSuNDLt+lxybSF51lo74arqs113dOZqwsptxNs5bwi7Q3q8npSC2AWmvjTncZf1l61e5DEizNn5mtufpsqk5+CZTuq00sP1wkNPv8jeEikVVlJso+GEwRtNs3QeBt2YP2V2ZI3Tx0e+7T89zK5tNASOLEytJAryGtkLc2PcBM5byyUWYkMQpMioYcDcchC6xN220Iv36Ot8pV0454RHLEwmmD7UWfIdX0zq3GjMPG5NKBtv5qiPEPekK2U51j1451BZoc3i+1ohSQ/UzzG5uYFFn2mwVUnO4O3JblXA91T51l3pB3QweDl7sNXMyEjbguSjrPcQNmwDkNc8CbCvDd0+xCC7RFi9wFulD3mJeXqxQevB4prrqgc0TmQ85NG/K43e2UwnMVAJIEBNfWRYR3HfnvivrIzMyo4Hgy+hfscvLo53jItAAAAABJRU5ErkJggg==">
|
|
41
|
+
</a>
|
|
42
|
+
<img src="https://img.shields.io/badge/python-3.6+-blue.svg" alt="Python Version">
|
|
43
|
+
<img alt="GitHub release (latest by date)" src="https://img.shields.io/github/v/release/MasoniteFramework/orm">
|
|
44
|
+
<img alt="License" src="https://img.shields.io/github/license/MasoniteFramework/orm">
|
|
45
|
+
<a href="https://github.com/psf/black"><img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg"></a>
|
|
46
|
+
</p>
|
|
47
|
+
|
|
48
|
+
## Installation & Usage
|
|
49
|
+
|
|
50
|
+
All documentation can be found here [https://orm.masoniteproject.com](https://orm.masoniteproject.com).
|
|
51
|
+
|
|
52
|
+
Hop on [Masonite Discord Community](https://discord.gg/TwKeFahmPZ) to ask any questions you need!
|
|
53
|
+
|
|
54
|
+
## Contributing
|
|
55
|
+
|
|
56
|
+
If you would like to contribute please read the [Contributing Documentation](CONTRIBUTING.md) here.
|
|
57
|
+
|
|
58
|
+
## License
|
|
59
|
+
|
|
60
|
+
Masonite ORM is open-sourced software licensed under the [MIT License](LICENSE).
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
- [x] fix scopes - need to find a new way to perform scopes
|
|
2
|
+
|
|
3
|
+
- [x] scopes need to be set on the model and then passed off to the query builder
|
|
4
|
+
|
|
5
|
+
- [x] global scopes
|
|
6
|
+
- on select need to call a scope
|
|
7
|
+
- on delete need to call a scope
|
|
8
|
+
- need to be able to remove global scopes
|
|
9
|
+
- need to be able to able to call something like with_trashed()
|
|
10
|
+
- this needs to remove global scopes only from the soft deletes class
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"""User Observer"""
|
|
2
|
+
|
|
3
|
+
from masoniteorm.models import Model
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class UserObserver:
|
|
7
|
+
def created(self, clients):
|
|
8
|
+
"""Handle the Clients "created" event.
|
|
9
|
+
|
|
10
|
+
Args:
|
|
11
|
+
clients (masoniteorm.models.Model): Clients model.
|
|
12
|
+
"""
|
|
13
|
+
pass
|
|
14
|
+
|
|
15
|
+
def creating(self, clients):
|
|
16
|
+
"""Handle the Clients "creating" event.
|
|
17
|
+
|
|
18
|
+
Args:
|
|
19
|
+
clients (masoniteorm.models.Model): Clients model.
|
|
20
|
+
"""
|
|
21
|
+
pass
|
|
22
|
+
|
|
23
|
+
def saving(self, clients):
|
|
24
|
+
"""Handle the Clients "saving" event.
|
|
25
|
+
|
|
26
|
+
Args:
|
|
27
|
+
clients (masoniteorm.models.Model): Clients model.
|
|
28
|
+
"""
|
|
29
|
+
pass
|
|
30
|
+
|
|
31
|
+
def saved(self, clients):
|
|
32
|
+
"""Handle the Clients "saved" event.
|
|
33
|
+
|
|
34
|
+
Args:
|
|
35
|
+
clients (masoniteorm.models.Model): Clients model.
|
|
36
|
+
"""
|
|
37
|
+
pass
|
|
38
|
+
|
|
39
|
+
def updating(self, clients):
|
|
40
|
+
"""Handle the Clients "updating" event.
|
|
41
|
+
|
|
42
|
+
Args:
|
|
43
|
+
clients (masoniteorm.models.Model): Clients model.
|
|
44
|
+
"""
|
|
45
|
+
pass
|
|
46
|
+
|
|
47
|
+
def updated(self, clients):
|
|
48
|
+
"""Handle the Clients "updated" event.
|
|
49
|
+
|
|
50
|
+
Args:
|
|
51
|
+
clients (masoniteorm.models.Model): Clients model.
|
|
52
|
+
"""
|
|
53
|
+
pass
|
|
54
|
+
|
|
55
|
+
def booted(self, clients):
|
|
56
|
+
"""Handle the Clients "booted" event.
|
|
57
|
+
|
|
58
|
+
Args:
|
|
59
|
+
clients (masoniteorm.models.Model): Clients model.
|
|
60
|
+
"""
|
|
61
|
+
pass
|
|
62
|
+
|
|
63
|
+
def booting(self, clients):
|
|
64
|
+
"""Handle the Clients "booting" event.
|
|
65
|
+
|
|
66
|
+
Args:
|
|
67
|
+
clients (masoniteorm.models.Model): Clients model.
|
|
68
|
+
"""
|
|
69
|
+
pass
|
|
70
|
+
|
|
71
|
+
def hydrating(self, clients):
|
|
72
|
+
"""Handle the Clients "hydrating" event.
|
|
73
|
+
|
|
74
|
+
Args:
|
|
75
|
+
clients (masoniteorm.models.Model): Clients model.
|
|
76
|
+
"""
|
|
77
|
+
pass
|
|
78
|
+
|
|
79
|
+
def hydrated(self, clients):
|
|
80
|
+
"""Handle the Clients "hydrated" event.
|
|
81
|
+
|
|
82
|
+
Args:
|
|
83
|
+
clients (masoniteorm.models.Model): Clients model.
|
|
84
|
+
"""
|
|
85
|
+
pass
|
|
86
|
+
|
|
87
|
+
def deleting(self, clients):
|
|
88
|
+
"""Handle the Clients "deleting" event.
|
|
89
|
+
|
|
90
|
+
Args:
|
|
91
|
+
clients (masoniteorm.models.Model): Clients model.
|
|
92
|
+
"""
|
|
93
|
+
pass
|
|
94
|
+
|
|
95
|
+
def deleted(self, clients):
|
|
96
|
+
"""Handle the Clients "deleted" event.
|
|
97
|
+
|
|
98
|
+
Args:
|
|
99
|
+
clients (masoniteorm.models.Model): Clients model.
|
|
100
|
+
"""
|
|
101
|
+
pass
|
masonite_orm-3.0.0/cc.py
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"""Sandbox experimental file used to quickly feature test features of the package
|
|
2
|
+
"""
|
|
3
|
+
|
|
4
|
+
from src.masoniteorm.query import QueryBuilder
|
|
5
|
+
from src.masoniteorm.connections import MySQLConnection, PostgresConnection
|
|
6
|
+
from src.masoniteorm.query.grammars import MySQLGrammar, PostgresGrammar
|
|
7
|
+
from src.masoniteorm.models import Model
|
|
8
|
+
from src.masoniteorm.relationships import has_many
|
|
9
|
+
import inspect
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
# builder = QueryBuilder(connection=PostgresConnection, grammar=PostgresGrammar).table("users").on("postgres")
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
# print(builder.where("id", 1).or_where(lambda q: q.where('id', 2).or_where('id', 3)).get())
|
|
17
|
+
|
|
18
|
+
class User(Model):
|
|
19
|
+
__connection__ = "sqlite"
|
|
20
|
+
__table__ = "users"
|
|
21
|
+
|
|
22
|
+
@has_many("id", "user_id")
|
|
23
|
+
def articles(self):
|
|
24
|
+
return Article
|
|
25
|
+
class Article(Model):
|
|
26
|
+
__connection__ = "sqlite"
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
# user = User.create({"name": "phill", "email": "phill"})
|
|
30
|
+
# print(inspect.isclass(User))
|
|
31
|
+
print(User.find(1).with_("articles").first().serialize())
|
|
32
|
+
|
|
33
|
+
# print(user.serialize())
|
|
34
|
+
# print(User.first())
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{% set data = load_setup_py_data() %}
|
|
2
|
+
|
|
3
|
+
package:
|
|
4
|
+
name: masonite-orm
|
|
5
|
+
version: {{ data['version'] }}
|
|
6
|
+
|
|
7
|
+
source:
|
|
8
|
+
path: ..
|
|
9
|
+
|
|
10
|
+
build:
|
|
11
|
+
number: 0
|
|
12
|
+
script: python setup.py install --single-version-externally-managed --record=record.txt
|
|
13
|
+
|
|
14
|
+
requirements:
|
|
15
|
+
build:
|
|
16
|
+
- python
|
|
17
|
+
|
|
18
|
+
run:
|
|
19
|
+
- python
|
|
20
|
+
|
|
21
|
+
test:
|
|
22
|
+
run:
|
|
23
|
+
- python -m pytest
|
|
24
|
+
|
|
25
|
+
about:
|
|
26
|
+
home: {{ data['url'] }}
|
|
27
|
+
license: {{ data['license'] }}
|
|
28
|
+
summary: {{ data['description'] }}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
from src.masoniteorm.migrations import Migration
|
|
2
|
+
from tests.User import User
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class CreateUsersTable(Migration):
|
|
6
|
+
|
|
7
|
+
def up(self):
|
|
8
|
+
"""Run the migrations."""
|
|
9
|
+
with self.schema.create('users') as table:
|
|
10
|
+
table.increments('id')
|
|
11
|
+
table.string('name')
|
|
12
|
+
table.string('email').unique()
|
|
13
|
+
table.string('password')
|
|
14
|
+
table.string('second_password').nullable()
|
|
15
|
+
table.string('remember_token').nullable()
|
|
16
|
+
table.timestamp('verified_at').nullable()
|
|
17
|
+
table.timestamps()
|
|
18
|
+
|
|
19
|
+
if not self.schema._dry:
|
|
20
|
+
User.on(self.connection).set_schema(self.schema_name).create({
|
|
21
|
+
'name': 'Joe',
|
|
22
|
+
'email': 'joe@email.com',
|
|
23
|
+
'password': 'secret'
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
def down(self):
|
|
27
|
+
"""Revert the migrations."""
|
|
28
|
+
self.schema.drop('users')
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
from src.masoniteorm.migrations.Migration import Migration
|
|
2
|
+
|
|
3
|
+
class CreateFriendsTable(Migration):
|
|
4
|
+
|
|
5
|
+
def up(self):
|
|
6
|
+
"""
|
|
7
|
+
Run the migrations.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
with self.schema.create('friends') as table:
|
|
11
|
+
table.increments('id')
|
|
12
|
+
table.string('name')
|
|
13
|
+
table.integer('age')
|
|
14
|
+
|
|
15
|
+
def down(self):
|
|
16
|
+
"""
|
|
17
|
+
Revert the migrations.
|
|
18
|
+
"""
|
|
19
|
+
self.schema.drop('friends')
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
from src.masoniteorm.migrations.Migration import Migration
|
|
2
|
+
|
|
3
|
+
class CreateArticlesTable(Migration):
|
|
4
|
+
|
|
5
|
+
def up(self):
|
|
6
|
+
"""
|
|
7
|
+
Run the migrations.
|
|
8
|
+
"""
|
|
9
|
+
with self.schema.create('fans') as table:
|
|
10
|
+
table.increments('id')
|
|
11
|
+
table.string('name')
|
|
12
|
+
table.integer('age')
|
|
13
|
+
|
|
14
|
+
def down(self):
|
|
15
|
+
"""
|
|
16
|
+
Revert the migrations.
|
|
17
|
+
"""
|
|
18
|
+
self.schema.drop('fans')
|