diff --git a/src/masoniteorm/query/QueryBuilder.py b/src/masoniteorm/query/QueryBuilder.py index ecc27c290..d7a7f2b2f 100644 --- a/src/masoniteorm/query/QueryBuilder.py +++ b/src/masoniteorm/query/QueryBuilder.py @@ -1,16 +1,16 @@ import inspect from copy import deepcopy from datetime import datetime -from typing import Any, Dict, List, Optional, Callable +from typing import Any, Callable, Dict, List, Optional from ..collection.Collection import Collection from ..config import load_config from ..exceptions import ( HTTP404, ConnectionNotRegistered, + InvalidArgument, ModelNotFound, MultipleRecordsFound, - InvalidArgument, ) from ..expressions.expressions import ( AggregateExpression, diff --git a/src/masoniteorm/query/grammars/BaseGrammar.py b/src/masoniteorm/query/grammars/BaseGrammar.py index 5d6f2e83d..d1136a62b 100644 --- a/src/masoniteorm/query/grammars/BaseGrammar.py +++ b/src/masoniteorm/query/grammars/BaseGrammar.py @@ -1,11 +1,11 @@ import re from ...expressions.expressions import ( - SubGroupExpression, - SubSelectExpression, - SelectExpression, JoinClause, OnClause, + SelectExpression, + SubGroupExpression, + SubSelectExpression, ) diff --git a/src/masoniteorm/query/grammars/PostgresGrammar.py b/src/masoniteorm/query/grammars/PostgresGrammar.py index ddcde4603..78cec54f6 100644 --- a/src/masoniteorm/query/grammars/PostgresGrammar.py +++ b/src/masoniteorm/query/grammars/PostgresGrammar.py @@ -1,6 +1,7 @@ -from .BaseGrammar import BaseGrammar import re +from .BaseGrammar import BaseGrammar + class PostgresGrammar(BaseGrammar): """Postgres grammar class.""" diff --git a/src/masoniteorm/query/grammars/SQLiteGrammar.py b/src/masoniteorm/query/grammars/SQLiteGrammar.py index 5b905b704..5a36a24ee 100644 --- a/src/masoniteorm/query/grammars/SQLiteGrammar.py +++ b/src/masoniteorm/query/grammars/SQLiteGrammar.py @@ -1,6 +1,7 @@ -from .BaseGrammar import BaseGrammar import re +from .BaseGrammar import BaseGrammar + class SQLiteGrammar(BaseGrammar): """SQLite grammar class.""" diff --git a/src/masoniteorm/query/grammars/__init__.py b/src/masoniteorm/query/grammars/__init__.py index 918adc940..ce130d5e9 100644 --- a/src/masoniteorm/query/grammars/__init__.py +++ b/src/masoniteorm/query/grammars/__init__.py @@ -1,4 +1,4 @@ -from .SQLiteGrammar import SQLiteGrammar -from .PostgresGrammar import PostgresGrammar -from .MySQLGrammar import MySQLGrammar from .MSSQLGrammar import MSSQLGrammar +from .MySQLGrammar import MySQLGrammar +from .PostgresGrammar import PostgresGrammar +from .SQLiteGrammar import SQLiteGrammar diff --git a/src/masoniteorm/query/processors/__init__.py b/src/masoniteorm/query/processors/__init__.py index 53666f25d..07916b1c6 100644 --- a/src/masoniteorm/query/processors/__init__.py +++ b/src/masoniteorm/query/processors/__init__.py @@ -1,4 +1,4 @@ +from .MSSQLPostProcessor import MSSQLPostProcessor from .MySQLPostProcessor import MySQLPostProcessor from .PostgresPostProcessor import PostgresPostProcessor from .SQLitePostProcessor import SQLitePostProcessor -from .MSSQLPostProcessor import MSSQLPostProcessor diff --git a/tests/postgres/builder/test_postgres_transaction.py b/tests/postgres/builder/test_postgres_transaction.py index a07a77f45..c8058ac1c 100644 --- a/tests/postgres/builder/test_postgres_transaction.py +++ b/tests/postgres/builder/test_postgres_transaction.py @@ -25,7 +25,6 @@ def get_builder(self, table="users"): grammar=PostgresGrammar, connection=connection, table=table, - # model=User, connection_details=DATABASES, ).on("postgres") diff --git a/tests/sqlite/builder/test_sqlite_builder_insert.py b/tests/sqlite/builder/test_sqlite_builder_insert.py index 52f6a29fb..2ba3670ac 100644 --- a/tests/sqlite/builder/test_sqlite_builder_insert.py +++ b/tests/sqlite/builder/test_sqlite_builder_insert.py @@ -6,8 +6,6 @@ from src.masoniteorm.models import Model from src.masoniteorm.query import QueryBuilder from src.masoniteorm.query.grammars import SQLiteGrammar -from src.masoniteorm.relationships import belongs_to -from tests.utils import MockConnectionFactory class User(Model): @@ -26,7 +24,6 @@ def get_builder(self, table="users"): connection_class=connection, connection="dev", table=table, - # model=User, connection_details=DATABASES, ).on("dev") diff --git a/tests/sqlite/builder/test_sqlite_builder_pagination.py b/tests/sqlite/builder/test_sqlite_builder_pagination.py index 09ab0b7cc..5c583553f 100644 --- a/tests/sqlite/builder/test_sqlite_builder_pagination.py +++ b/tests/sqlite/builder/test_sqlite_builder_pagination.py @@ -6,8 +6,6 @@ from src.masoniteorm.models import Model from src.masoniteorm.query import QueryBuilder from src.masoniteorm.query.grammars import SQLiteGrammar -from src.masoniteorm.relationships import belongs_to -from tests.utils import MockConnectionFactory class User(Model): diff --git a/tests/sqlite/builder/test_sqlite_query_builder_eager_loading.py b/tests/sqlite/builder/test_sqlite_query_builder_eager_loading.py index d67ef39ef..725870392 100644 --- a/tests/sqlite/builder/test_sqlite_query_builder_eager_loading.py +++ b/tests/sqlite/builder/test_sqlite_query_builder_eager_loading.py @@ -7,7 +7,6 @@ from src.masoniteorm.query import QueryBuilder from src.masoniteorm.query.grammars import SQLiteGrammar from src.masoniteorm.relationships import belongs_to, has_many -from tests.utils import MockConnectionFactory class Logo(Model): diff --git a/tests/sqlite/builder/test_sqlite_query_builder_relationships.py b/tests/sqlite/builder/test_sqlite_query_builder_relationships.py index 291f1876b..5fbf49251 100644 --- a/tests/sqlite/builder/test_sqlite_query_builder_relationships.py +++ b/tests/sqlite/builder/test_sqlite_query_builder_relationships.py @@ -1,7 +1,5 @@ -import inspect import unittest -from src.masoniteorm.connections import ConnectionFactory from src.masoniteorm.models import Model from src.masoniteorm.query import QueryBuilder from src.masoniteorm.query.grammars import SQLiteGrammar diff --git a/tests/sqlite/builder/test_sqlite_transaction.py b/tests/sqlite/builder/test_sqlite_transaction.py index ea1c40b4d..47c3832c2 100644 --- a/tests/sqlite/builder/test_sqlite_transaction.py +++ b/tests/sqlite/builder/test_sqlite_transaction.py @@ -1,4 +1,3 @@ -import inspect import unittest from tests.integrations.config.database import DATABASES @@ -6,8 +5,6 @@ from src.masoniteorm.models import Model from src.masoniteorm.query import QueryBuilder from src.masoniteorm.query.grammars import SQLiteGrammar -from src.masoniteorm.relationships import belongs_to -from tests.utils import MockConnectionFactory from tests.integrations.config.database import DB from src.masoniteorm.collection import Collection