Skip to content

Database resources

database

DatabaseProvider

Database-scoped provider — deploys schemas, database roles, and grants within one database.

Parameters:

Name Type Description Default
session Any

Active Snowpark Session.

required
Source code in src/pinky_provider/resources/database/__init__.py
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
class DatabaseProvider:
    """Database-scoped provider — deploys schemas, database roles, and grants within one database.

    Args:
        session: Active Snowpark ``Session``.
    """

    def __init__(self, session: Any) -> None:
        self._session = session

    def plan(self, source: str, target: str, vars: dict[str, str] | None = None) -> list[Any]:
        """Compute changes without applying them.

        Args:
            source: ``manifest.yml`` path.
            target: Target database as ``DATABASE``.
            vars: Jinja2 variables.

        Returns:
            Ordered list of :class:`~pinky_provider.core.diff.ResourceDiff`.
        """
        raise NotImplementedError("DatabaseProvider is not implemented yet")

    def apply(self, source: str, target: str, vars: dict[str, str] | None = None) -> None:
        """Apply the manifest to the target database.

        Args:
            source: ``manifest.yml`` path.
            target: Target database as ``DATABASE``.
            vars: Jinja2 variables.
        """
        ...

apply(source, target, vars=None)

Apply the manifest to the target database.

Parameters:

Name Type Description Default
source str

manifest.yml path.

required
target str

Target database as DATABASE.

required
vars dict[str, str] | None

Jinja2 variables.

None
Source code in src/pinky_provider/resources/database/__init__.py
29
30
31
32
33
34
35
36
37
def apply(self, source: str, target: str, vars: dict[str, str] | None = None) -> None:
    """Apply the manifest to the target database.

    Args:
        source: ``manifest.yml`` path.
        target: Target database as ``DATABASE``.
        vars: Jinja2 variables.
    """
    ...

plan(source, target, vars=None)

Compute changes without applying them.

Parameters:

Name Type Description Default
source str

manifest.yml path.

required
target str

Target database as DATABASE.

required
vars dict[str, str] | None

Jinja2 variables.

None

Returns:

Type Description
list[Any]

Ordered list of :class:~pinky_provider.core.diff.ResourceDiff.

Source code in src/pinky_provider/resources/database/__init__.py
16
17
18
19
20
21
22
23
24
25
26
27
def plan(self, source: str, target: str, vars: dict[str, str] | None = None) -> list[Any]:
    """Compute changes without applying them.

    Args:
        source: ``manifest.yml`` path.
        target: Target database as ``DATABASE``.
        vars: Jinja2 variables.

    Returns:
        Ordered list of :class:`~pinky_provider.core.diff.ResourceDiff`.
    """
    raise NotImplementedError("DatabaseProvider is not implemented yet")

schema

database_role

grant