Skip to content

Commit

Permalink
Add schema change attrs to connection create
Browse files Browse the repository at this point in the history
  • Loading branch information
alovew committed Nov 28, 2022
1 parent 61bf812 commit 5a59579
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 1 deletion.
2 changes: 2 additions & 0 deletions airbyte-api/src/main/openapi/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3371,6 +3371,8 @@ components:
format: uuid
geography:
$ref: "#/components/schemas/Geography"
nonBreakingChangesPreference:
$ref: "#/components/schemas/NonBreakingChangesPreference"
ConnectionStateCreateOrUpdate:
type: object
required:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,9 @@ private void writeStandardSync(final StandardSync standardSync, final DSLContext
.set(CONNECTION.GEOGRAPHY, Enums.toEnum(standardSync.getGeography().value(),
io.airbyte.db.instance.configs.jooq.generated.enums.GeographyType.class).orElseThrow())
.set(CONNECTION.BREAKING_CHANGE, standardSync.getBreakingChange())
.set(CONNECTION.NON_BREAKING_CHANGE_PREFERENCE,
standardSync.getNonBreakingChangesPreference().value())
.set(CONNECTION.NOTIFY_SCHEMA_CHANGES, standardSync.getNotifySchemaChanges())
.set(CONNECTION.CREATED_AT, timestamp)
.set(CONNECTION.UPDATED_AT, timestamp)
.execute();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,9 @@ public ConnectionRead createConnection(final ConnectionCreate connectionCreate)
.withStatus(ApiPojoConverters.toPersistenceStatus(connectionCreate.getStatus()))
.withSourceCatalogId(connectionCreate.getSourceCatalogId())
.withGeography(getGeographyFromConnectionCreateOrWorkspace(connectionCreate))
.withBreakingChange(false);
.withBreakingChange(false)
.withNonBreakingChangesPreference(
ApiPojoConverters.toPersistenceNonBreakingChangesPreference(connectionCreate.getNonBreakingChangesPreference()));
if (connectionCreate.getResourceRequirements() != null) {
standardSync.withResourceRequirements(ApiPojoConverters.resourceRequirementsToInternal(connectionCreate.getResourceRequirements()));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -621,6 +621,7 @@ protected static ConnectionCreate toConnectionCreate(final WebBackendConnectionC
connectionCreate.resourceRequirements(webBackendConnectionCreate.getResourceRequirements());
connectionCreate.sourceCatalogId(webBackendConnectionCreate.getSourceCatalogId());
connectionCreate.geography(webBackendConnectionCreate.getGeography());
connectionCreate.nonBreakingChangesPreference(webBackendConnectionCreate.getNonBreakingChangesPreference());

return connectionCreate;
}
Expand Down
1 change: 1 addition & 0 deletions docs/reference/api/generated-api-html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12037,6 +12037,7 @@ <h3><a name="WebBackendConnectionCreate"><code>WebBackendConnectionCreate</code>
<div class="param">operations (optional)</div><div class="param-desc"><span class="param-type"><a href="#OperationCreate">array[OperationCreate]</a></span> </div>
<div class="param">sourceCatalogId (optional)</div><div class="param-desc"><span class="param-type"><a href="#UUID">UUID</a></span> format: uuid</div>
<div class="param">geography (optional)</div><div class="param-desc"><span class="param-type"><a href="#Geography">Geography</a></span> </div>
<div class="param">nonBreakingChangesPreference (optional)</div><div class="param-desc"><span class="param-type"><a href="#NonBreakingChangesPreference">NonBreakingChangesPreference</a></span> </div>
</div> <!-- field-items -->
</div>
<div class="model">
Expand Down
5 changes: 5 additions & 0 deletions tools/openapi2jsonschema/examples/airbyte.local/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2638,6 +2638,11 @@ components:
$ref: "#/components/schemas/ConnectionStatus"
syncCatalog:
$ref: "#/components/schemas/AirbyteCatalog"
nonBreakingChangesPreference:
enum:
- ignore
- disable
type: string
required:
- connection
- sourceId
Expand Down

0 comments on commit 5a59579

Please sign in to comment.