-
Notifications
You must be signed in to change notification settings - Fork 196
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
130 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from dlt.destinations.impl.postgres.factory import postgres | ||
from dlt.destinations.impl.snowflake.factory import snowflake | ||
from dlt.destinations.impl.filesystem.factory import filesystem | ||
|
||
|
||
__all__ = [ | ||
"postgres", | ||
"snowflake", | ||
"filesystem", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import typing as t | ||
|
||
from dlt.destinations.impl.filesystem.configuration import FilesystemDestinationClientConfiguration | ||
from dlt.destinations.impl import filesystem as _filesystem | ||
from dlt.common.configuration import with_config, known_sections | ||
from dlt.common.destination.reference import DestinationClientConfiguration, DestinationFactory | ||
from dlt.common.storages.configuration import FileSystemCredentials | ||
|
||
|
||
class filesystem(DestinationFactory): | ||
|
||
destination = _filesystem | ||
|
||
@with_config(spec=FilesystemDestinationClientConfiguration, sections=(known_sections.DESTINATION, 'filesystem'), accept_partial=True) | ||
def __init__( | ||
self, | ||
bucket_url: str = None, | ||
credentials: FileSystemCredentials = None, | ||
**kwargs: t.Any, | ||
) -> None: | ||
cfg: FilesystemDestinationClientConfiguration = kwargs['_dlt_config'] | ||
self.credentials = cfg.credentials | ||
self.config_params = { | ||
"credentials": cfg.credentials, | ||
"bucket_url": cfg.bucket_url, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import typing as t | ||
|
||
from dlt.common.configuration import with_config, known_sections | ||
from dlt.common.destination.reference import DestinationClientConfiguration, DestinationFactory | ||
|
||
from dlt.destinations.impl.postgres.configuration import PostgresCredentials, PostgresClientConfiguration | ||
from dlt.destinations.impl import postgres as _postgres | ||
|
||
|
||
class postgres(DestinationFactory): | ||
|
||
destination = _postgres | ||
|
||
@with_config(spec=PostgresClientConfiguration, sections=(known_sections.DESTINATION, 'postgres'), accept_partial=True) | ||
def __init__( | ||
self, | ||
credentials: PostgresCredentials = None, | ||
create_indexes: bool = True, | ||
**kwargs: t.Any, | ||
) -> None: | ||
cfg: PostgresClientConfiguration = kwargs['_dlt_config'] | ||
self.credentials = cfg.credentials | ||
self.config_params = { | ||
"created_indexes": cfg.create_indexes, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import typing as t | ||
|
||
from dlt.destinations.impl.snowflake.configuration import SnowflakeCredentials, SnowflakeClientConfiguration | ||
from dlt.destinations.impl import snowflake as _snowflake | ||
from dlt.common.configuration import with_config, known_sections | ||
from dlt.common.destination.reference import DestinationClientConfiguration, DestinationFactory | ||
|
||
|
||
class snowflake(DestinationFactory): | ||
|
||
destination = _snowflake | ||
|
||
@with_config(spec=SnowflakeClientConfiguration, sections=(known_sections.DESTINATION, 'snowflake'), accept_partial=True) | ||
def __init__( | ||
self, | ||
credentials: SnowflakeCredentials = None, | ||
stage_name: t.Optional[str] = None, | ||
keep_staged_files: bool = True, | ||
**kwargs: t.Any, | ||
) -> None: | ||
cfg: SnowflakeClientConfiguration = kwargs['_dlt_config'] | ||
self.credentials = cfg.credentials | ||
self.config_params = { | ||
"stage_name": cfg.stage_name, | ||
"keep_staged_files": cfg.keep_staged_files, | ||
} |