Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ include LICENSE README.md logo.svg
recursive-include edb/edgeql-parser *
recursive-include edb/edgeql-parser/edgeql-parser-python *
recursive-include edb/server/protocol/auth_ext/_static *
include edb/server/protocol/ai_reference.json
4 changes: 2 additions & 2 deletions edb/pgsql/delta.py
Original file line number Diff line number Diff line change
Expand Up @@ -3611,13 +3611,13 @@ def delete_index(
)
return dbops.DropIndex(pg_index, conditions=(index_exists,))

def apply(
def _delete_innards(
self,
schema: s_schema.Schema,
context: sd.CommandContext,
) -> s_schema.Schema:
orig_schema = schema
schema = super().apply(schema, context)
schema = super()._delete_innards(schema, context)
index = self.scls

if index.get_abstract(orig_schema):
Expand Down
8 changes: 8 additions & 0 deletions edb/schema/ddl.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@

from collections import defaultdict
import itertools
import pathlib

from edb import errors

Expand Down Expand Up @@ -227,6 +228,7 @@ def _filter(schema: s_schema.Schema, obj: so.Object) -> bool:
# TODO: Fix this.
if not include_derived_types:
excluded_modules.add(sn.UnqualName('__derived__'))
excluded_modules.add(sn.UnqualName('__ext_generated_types__'))

excluded_modules.add(sn.UnqualName('__ext_casts__'))
excluded_modules.add(sn.UnqualName('__ext_index_matches__'))
Expand Down Expand Up @@ -630,6 +632,7 @@ def apply_ddl_script_ex(
Mapping[tuple[sn.Name, Optional[str]], uuid.UUID]
]=None,
compat_ver: Optional[verutils.Version] = None,
reference_paths: Optional[Mapping[str, pathlib.Path]] = None
) -> tuple[s_schema.Schema, sd.DeltaRoot]:

delta = sd.DeltaRoot()
Expand All @@ -650,6 +653,7 @@ def apply_ddl_script_ex(
store_migration_sdl=store_migration_sdl,
schema_object_ids=schema_object_ids,
compat_ver=compat_ver,
reference_paths=reference_paths,
)

delta.add(cmd)
Expand All @@ -669,6 +673,7 @@ def delta_from_ddl(
Mapping[tuple[sn.Name, Optional[str]], uuid.UUID]
]=None,
compat_ver: Optional[verutils.Version] = None,
reference_paths: Optional[Mapping[str, pathlib.Path]] = None
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should pass this in as a mapping to the data. Or if we want to generalize things further, to some abstract interface type for retrieving data?

) -> sd.DeltaRoot:
_, cmd = delta_and_schema_from_ddl(
ddl_stmt,
Expand All @@ -679,6 +684,7 @@ def delta_from_ddl(
store_migration_sdl=store_migration_sdl,
schema_object_ids=schema_object_ids,
compat_ver=compat_ver,
reference_paths=reference_paths,
)
return cmd

Expand All @@ -696,6 +702,7 @@ def delta_and_schema_from_ddl(
Mapping[tuple[sn.Name, Optional[str]], uuid.UUID]
]=None,
compat_ver: Optional[verutils.Version] = None,
reference_paths: Optional[Mapping[str, pathlib.Path]] = None
) -> tuple[s_schema.Schema, sd.DeltaRoot]:
delta = sd.DeltaRoot()
context = sd.CommandContext(
Expand All @@ -707,6 +714,7 @@ def delta_and_schema_from_ddl(
store_migration_sdl=store_migration_sdl,
schema_object_ids=schema_object_ids,
compat_ver=compat_ver,
reference_paths=reference_paths,
)

with context(sd.DeltaRootContext(schema=schema, op=delta)):
Expand Down
3 changes: 3 additions & 0 deletions edb/schema/delta.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import contextlib
import functools
import itertools
import pathlib
import uuid

from edb import errors
Expand Down Expand Up @@ -1292,6 +1293,7 @@ def __init__(
backend_runtime_params: Optional[Any] = None,
compat_ver: Optional[verutils.Version] = None,
include_ext_version: bool = True,
reference_paths: Optional[Mapping[str, pathlib.Path]] = None
) -> None:
self.stack: list[CommandContextToken[Command]] = []
self._cache: dict[Hashable, Any] = {}
Expand Down Expand Up @@ -1320,6 +1322,7 @@ def __init__(
] = collections.defaultdict(list)
self.compat_ver = compat_ver
self.include_ext_version = include_ext_version
self.reference_paths = reference_paths

@property
def modaliases(self) -> Mapping[Optional[str], str]:
Expand Down
1 change: 1 addition & 0 deletions edb/schema/expraliases.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,7 @@ def _create_alias_types(
dict(
alias_is_persistent=True,
expr_type=s_types.ExprType.Select,
is_schema_generated=True,
from_alias=True,
from_global=is_global,
),
Expand Down
Loading