( projectId: string, locationId: string, ds: DatasourceYaml, )
| 244 | } |
| 245 | |
| 246 | export function toDatasource( |
| 247 | projectId: string, |
| 248 | locationId: string, |
| 249 | ds: DatasourceYaml, |
| 250 | ): Datasource { |
| 251 | if (ds?.postgresql) { |
| 252 | return { |
| 253 | postgresql: { |
| 254 | database: ds.postgresql.database, |
| 255 | schema: ds.postgresql.schema, |
| 256 | cloudSql: { |
| 257 | instance: `projects/${projectId}/locations/${locationId}/instances/${ds.postgresql.cloudSql.instanceId}`, |
| 258 | }, |
| 259 | schemaValidation: ds.postgresql.schemaValidation, |
| 260 | }, |
| 261 | }; |
| 262 | } |
| 263 | if (ds?.httpGraphql) { |
| 264 | return { |
| 265 | httpGraphql: { |
| 266 | uri: ds.httpGraphql.uri, |
| 267 | timeout: ds.httpGraphql.timeout, |
| 268 | }, |
| 269 | }; |
| 270 | } |
| 271 | return {}; |
| 272 | } |
| 273 | |
| 274 | /** Returns the main schema YAML for a SQL Connect YAML */ |
| 275 | export function mainSchemaYaml(dataconnectYaml: DataConnectYaml): SchemaYaml { |
no outgoing calls
no test coverage detected
searching dependent graphs…