Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wip #50434

Draft
wants to merge 42 commits into
base: move/destination-mssql-v2
Choose a base branch
from
Draft

wip #50434

Conversation

gosusnp
Copy link
Contributor

@gosusnp gosusnp commented Dec 28, 2024

What

How

Review guide

User Impact

Can this PR be safely reverted and rolled back?

  • YES 💚
  • NO ❌

Copy link

vercel bot commented Dec 28, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
airbyte-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 3, 2025 5:10pm

Base automatically changed from gosusnp/mssql-v2-check-tests to move/destination-mssql-v2 December 30, 2024 18:28
}
} else {
try {
when (value) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may make this cleaner to encapsulate this logic in an extension function on the value -- something like value.setStatementValue(statement=statement). The extension function would encapsulate this when block, making this code easier to test separate from the type conversion expectations.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

.filter { field -> field.name !in airbyteFields }
.map { field ->
try {
when (field.type.type) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above...this feels like another good use of an extension function on the type to encapsulate this conversion logic and make it easier to test.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated.

private val dataSourceFactory: MSSQLDataSourceFactory
) : DestinationWriter {
override fun createStreamLoader(stream: DestinationStream): StreamLoader {
val dataSource = dataSourceFactory.getDataSource(config)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may want to do this in the constructor/init/post construct method. Otherwise, we are creating a data source per stream, which means d x s connections instead of just d connections if the data source is shared between streams (preferred to limit connections).

}
}
} catch (ex: Exception) {
KotlinLogging.logger {}.error(ex) { ex.message }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably be a file level variable to avoid creating the logger each time that the code catches.

@jdpgrailsdev jdpgrailsdev force-pushed the move/destination-mssql-v2 branch from 140aeda to 57bcf83 Compare December 30, 2024 19:09
@jdpgrailsdev jdpgrailsdev force-pushed the move/destination-mssql-v2 branch from 57bcf83 to bc730ce Compare January 2, 2025 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants