3
3
from attrs import define as _attrs_define
4
4
from attrs import field as _attrs_field
5
5
6
+ from ..models .duckdb_read_mode import DuckdbReadMode
7
+ from ..models .duckdb_source_files_type import DuckdbSourceFilesType
6
8
from ..types import UNSET , Unset
7
9
8
10
if TYPE_CHECKING :
18
20
class DuckdbParametersSpec :
19
21
"""
20
22
Attributes:
21
- in_memory (Union[Unset, bool]): To use the special value :memory: to create an in-memory database where no data
22
- is persisted to disk (i.e., all data is lost when you exit the process). The value can be in the
23
- ${ENVIRONMENT_VARIABLE_NAME} format to use dynamic substitution.
23
+ read_mode (Union[Unset, DuckdbReadMode]):
24
+ source_files_type (Union[Unset, DuckdbSourceFilesType]):
24
25
database (Union[Unset, str]): DuckDB database name. The value can be in the ${ENVIRONMENT_VARIABLE_NAME} format
25
26
to use dynamic substitution.
26
27
options (Union[Unset, str]): DuckDB connection 'options' initialization parameter. For example setting this to
@@ -30,14 +31,22 @@ class DuckdbParametersSpec:
30
31
to the JDBC connection string, a key/value dictionary.
31
32
"""
32
33
33
- in_memory : Union [Unset , bool ] = UNSET
34
+ read_mode : Union [Unset , DuckdbReadMode ] = UNSET
35
+ source_files_type : Union [Unset , DuckdbSourceFilesType ] = UNSET
34
36
database : Union [Unset , str ] = UNSET
35
37
options : Union [Unset , str ] = UNSET
36
38
properties : Union [Unset , "DuckdbParametersSpecProperties" ] = UNSET
37
39
additional_properties : Dict [str , Any ] = _attrs_field (init = False , factory = dict )
38
40
39
41
def to_dict (self ) -> Dict [str , Any ]:
40
- in_memory = self .in_memory
42
+ read_mode : Union [Unset , str ] = UNSET
43
+ if not isinstance (self .read_mode , Unset ):
44
+ read_mode = self .read_mode .value
45
+
46
+ source_files_type : Union [Unset , str ] = UNSET
47
+ if not isinstance (self .source_files_type , Unset ):
48
+ source_files_type = self .source_files_type .value
49
+
41
50
database = self .database
42
51
options = self .options
43
52
properties : Union [Unset , Dict [str , Any ]] = UNSET
@@ -47,8 +56,10 @@ def to_dict(self) -> Dict[str, Any]:
47
56
field_dict : Dict [str , Any ] = {}
48
57
field_dict .update (self .additional_properties )
49
58
field_dict .update ({})
50
- if in_memory is not UNSET :
51
- field_dict ["in_memory" ] = in_memory
59
+ if read_mode is not UNSET :
60
+ field_dict ["read_mode" ] = read_mode
61
+ if source_files_type is not UNSET :
62
+ field_dict ["source_files_type" ] = source_files_type
52
63
if database is not UNSET :
53
64
field_dict ["database" ] = database
54
65
if options is not UNSET :
@@ -65,7 +76,19 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
65
76
)
66
77
67
78
d = src_dict .copy ()
68
- in_memory = d .pop ("in_memory" , UNSET )
79
+ _read_mode = d .pop ("read_mode" , UNSET )
80
+ read_mode : Union [Unset , DuckdbReadMode ]
81
+ if isinstance (_read_mode , Unset ):
82
+ read_mode = UNSET
83
+ else :
84
+ read_mode = DuckdbReadMode (_read_mode )
85
+
86
+ _source_files_type = d .pop ("source_files_type" , UNSET )
87
+ source_files_type : Union [Unset , DuckdbSourceFilesType ]
88
+ if isinstance (_source_files_type , Unset ):
89
+ source_files_type = UNSET
90
+ else :
91
+ source_files_type = DuckdbSourceFilesType (_source_files_type )
69
92
70
93
database = d .pop ("database" , UNSET )
71
94
@@ -79,7 +102,8 @@ def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T:
79
102
properties = DuckdbParametersSpecProperties .from_dict (_properties )
80
103
81
104
duckdb_parameters_spec = cls (
82
- in_memory = in_memory ,
105
+ read_mode = read_mode ,
106
+ source_files_type = source_files_type ,
83
107
database = database ,
84
108
options = options ,
85
109
properties = properties ,
0 commit comments