main commit
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-10-16 16:30:25 +09:00
parent 91c7e04474
commit 537e7b363f
1146 changed files with 45926 additions and 77196 deletions

View File

@@ -1,5 +1,5 @@
# engine/mock.py
# Copyright (C) 2005-2025 the SQLAlchemy authors and contributors
# Copyright (C) 2005-2023 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
@@ -27,9 +27,10 @@ if typing.TYPE_CHECKING:
from .interfaces import Dialect
from .url import URL
from ..sql.base import Executable
from ..sql.ddl import InvokeDDLBase
from ..sql.ddl import SchemaDropper
from ..sql.ddl import SchemaGenerator
from ..sql.schema import HasSchemaAttr
from ..sql.visitors import Visitable
from ..sql.schema import SchemaItem
class MockConnection:
@@ -52,14 +53,12 @@ class MockConnection:
def _run_ddl_visitor(
self,
visitorcallable: Type[InvokeDDLBase],
element: Visitable,
visitorcallable: Type[Union[SchemaGenerator, SchemaDropper]],
element: SchemaItem,
**kwargs: Any,
) -> None:
kwargs["checkfirst"] = False
visitorcallable(
dialect=self.dialect, connection=self, **kwargs
).traverse_single(element)
visitorcallable(self.dialect, self, **kwargs).traverse_single(element)
def execute(
self,
@@ -91,12 +90,10 @@ def create_mock_engine(
from sqlalchemy import create_mock_engine
def dump(sql, *multiparams, **params):
print(sql.compile(dialect=engine.dialect))
engine = create_mock_engine("postgresql+psycopg2://", dump)
engine = create_mock_engine('postgresql+psycopg2://', dump)
metadata.create_all(engine, checkfirst=False)
:param url: A string URL which typically needs to contain only the