-
Notifications
You must be signed in to change notification settings - Fork 232
/
azure.ai.ml.data_transfer.Database.yml
87 lines (86 loc) · 3.56 KB
/
azure.ai.ml.data_transfer.Database.yml
1
2
3
4
5
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
### YamlMime:PythonClass
uid: azure.ai.ml.data_transfer.Database
name: Database
fullName: azure.ai.ml.data_transfer.Database
module: azure.ai.ml.data_transfer
inheritances:
- azure.ai.ml.entities._mixins.DictMixin
- azure.ai.ml.entities._mixins.RestTranslatableMixin
summary: Define a database class for a DataTransfer Component or Job.
constructor:
syntax: 'Database(*, query: str | None = None, table_name: str | None = None, stored_procedure:
str | None = None, stored_procedure_params: List[Dict] | None = None, connection:
str | None = None)'
keywordOnlyParameters:
- name: query
description: The SQL query to retrieve data from the database.
types:
- <xref:str>
- name: table_name
description: The name of the database table.
types:
- <xref:str>
- name: stored_procedure
description: The name of the stored procedure.
types:
- <xref:str>
- name: stored_procedure_params
description: The parameters for the stored procedure.
types:
- <xref:typing.List>
- name: connection
description: 'The connection string for the database.
The credential information should be stored in the connection.'
types:
- <xref:str>
examples:
- "Create a database and querying a database table.<!--[!code-python[Main](les\\ml_samples_input_output_configurations.py\
\ )]-->\n\n<!-- literal_block {\"ids\": [], \"classes\": [], \"names\": [], \"dupnames\"\
: [], \"backrefs\": [], \"source\": \"C:\\\\hostedtoolcache\\\\windows\\\\Python\\\
\\3.11.9\\\\x64\\\\Lib\\\\site-packages\\\\py2docfx\\\\dist_temp\\\\8\\\\azure-ai-ml-1.16.1\\\
\\samples\\\\ml_samples_input_output_configurations.py\", \"xml:space\": \"preserve\"\
, \"force\": false, \"language\": \"python\", \"highlight_args\": {\"linenostart\"\
: 1}, \"linenos\": false} -->\n\n````python\n\n from azure.ai.ml.entities._inputs_outputs\
\ import Database\n\n # For querying a database table\n source_database = Database(query=\"\
SELECT * FROM my_table\", connection=\"azureml:my_azuresql_connection\")\n\n #\
\ For invoking a stored procedure with parameters\n stored_procedure_params =\
\ [\n {\"name\": \"job\", \"value\": \"Engineer\", \"type\": \"String\"},\n\
\ {\"name\": \"department\", \"value\": \"Engineering\", \"type\": \"String\"\
},\n ]\n source_database = Database(\n stored_procedure=\"SelectEmployeeByJobAndDepartment\"\
,\n stored_procedure_params=stored_procedure_params,\n connection=\"\
azureml:my_azuresql_connection\",\n )\n\n\n ````\n"
methods:
- uid: azure.ai.ml.data_transfer.Database.get
name: get
signature: 'get(key: Any, default: Any | None = None) -> Any'
parameters:
- name: key
isRequired: true
- name: default
defaultValue: None
- uid: azure.ai.ml.data_transfer.Database.has_key
name: has_key
signature: 'has_key(k: Any) -> bool'
parameters:
- name: k
isRequired: true
- uid: azure.ai.ml.data_transfer.Database.items
name: items
signature: items() -> list
- uid: azure.ai.ml.data_transfer.Database.keys
name: keys
signature: keys() -> list
- uid: azure.ai.ml.data_transfer.Database.update
name: update
signature: 'update(*args: Any, **kwargs: Any) -> None'
- uid: azure.ai.ml.data_transfer.Database.values
name: values
signature: values() -> list
attributes:
- uid: azure.ai.ml.data_transfer.Database.stored_procedure_params
name: stored_procedure_params
summary: Get or set the parameters for the stored procedure.
return:
description: The parameters for the stored procedure.
types:
- <xref:typing.List>[<xref:StoredProcedureParameter>]