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

Add MS SQLServer support to JDBC device registry #2317

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lhotari
Copy link
Contributor

@lhotari lhotari commented Nov 23, 2020

Motivation

  • Add Microsoft SQLServer support to JDBC device registry

Changes

Notice

SQLServer requires SelectMethod=Cursor in JDBC URL. This was needed to support the "SELECT ... FOR UPDATE" syntax used in JDBC device registry.

@kaniyan
Copy link
Contributor

kaniyan commented Nov 23, 2020

@lhotari Would you mind creating a separate PR for the last 2 commits (Include hono-service-device-registry-jdbc image in pushed images & tenantAdapterStore should use tenantsProperties().getAdapter())? One is a bug and the other extends the script also to push the JDBC device registry image to the Docker Hub. IMHO those can be separately reviewed and merged.

@lhotari
Copy link
Contributor Author

lhotari commented Nov 23, 2020

Would you mind creating a separate PR for the last 2 commits (Include hono-service-device-registry-jdbc image in pushed images & tenantAdapterStore should use tenantsProperties().getAdapter())? One is a bug and the other extends the script also to push the JDBC device registry image to the Docker Hub. IMHO those can be separately reviewed and merged.

@kaniyan thanks for the feedback. I moved those commits out to new PRs #2321 and #2322 as you have suggested.

@kaniyan
Copy link
Contributor

kaniyan commented Nov 24, 2020

@kaniyan thanks for the feedback. I moved those commits out to new PRs #2321 and #2322 as you have suggested.

Thank your for those PRs and they have been merged.

Copy link
Contributor

@ctron ctron left a comment

Choose a reason for hiding this comment

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

Looks good to me. With a small note on the naming … and big question mark on the "license acceptance".

@@ -0,0 +1 @@
mcr.microsoft.com/mssql/server:2017-CU12
Copy link
Contributor

Choose a reason for hiding this comment

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

I have no idea what this means.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

https://www.testcontainers.org/modules/databases/mssqlserver/ explains it. I'll remove that file and use the code based method for accepting the Docker container EULA.

@lhotari
Copy link
Contributor Author

lhotari commented Nov 26, 2020

@ctron I have address the review comments. Please review the changes.

@ctron ctron self-requested a review November 26, 2020 08:08
Copy link
Contributor

@ctron ctron left a comment

Choose a reason for hiding this comment

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

https://www.testcontainers.org/modules/databases/mssqlserver/ explains it. I'll remove that file and use the code based method for accepting the Docker container EULA.

So that would be a no-go for me. Unless I misunderstood the situation:

Everyone running the Hono tests now would automatically accept this EULA. Which definitely is not the case, as people aren't actively accepting anything when running Hono tests. And we are not confirming that with the end user.

@lhotari
Copy link
Contributor Author

lhotari commented Nov 26, 2020

https://www.testcontainers.org/modules/databases/mssqlserver/ explains it. I'll remove that file and use the code based method for accepting the Docker container EULA.

So that would be a no-go for me. Unless I misunderstood the situation:

Everyone running the Hono tests now would automatically accept this EULA. Which definitely is not the case, as people aren't actively accepting anything when running Hono tests. And we are not confirming that with the end user.

@ctron do you think that it would be possible to accept the EULA in CI (Github Actions Workflow) ? In that case I could modify the default build to skip the MS SQL Server tests unless a certain flag is given.
I'm open for any proposals to get this resolved. I think it would be valuable to have integration tests as part of the Hono CI for MS SQL Server since that's the default DB on Azure.

@ctron
Copy link
Contributor

ctron commented Nov 26, 2020

https://www.testcontainers.org/modules/databases/mssqlserver/ explains it. I'll remove that file and use the code based method for accepting the Docker container EULA.

So that would be a no-go for me. Unless I misunderstood the situation:
Everyone running the Hono tests now would automatically accept this EULA. Which definitely is not the case, as people aren't actively accepting anything when running Hono tests. And we are not confirming that with the end user.

@ctron do you think that it would be possible to accept the EULA in CI (Github Actions Workflow) ? In that case I could modify the default build to skip the MS SQL Server tests unless a certain flag is given.
I'm open for any proposals to get this resolved. I think it would be valuable to have integration tests as part of the Hono CI for MS SQL Server since that's the default DB on Azure.

I have no idea. And I would forward this question to the EMO (Eclipse Management Organization).

@sophokles73
Copy link
Contributor

@lhotari I am not sure about the outcome of the discussion around the SQL Server license issue. Regardless of that, the fixes for the PostgreSQL dialect are very valuable FMPOV. Would you mind splitting the PR up into two parts, one dealing with fixes for PostgreSQL and another one for adding support for SQL server? We could then go on and merge the first PR while dealing with the licensing issues.

@ctron WDYT? Does that make sense to you as well?

@lhotari
Copy link
Contributor Author

lhotari commented Dec 18, 2020

@lhotari I am not sure about the outcome of the discussion around the SQL Server license issue. Regardless of that, the fixes for the PostgreSQL dialect are very valuable FMPOV. Would you mind splitting the PR up into two parts, one dealing with fixes for PostgreSQL and another one for adding support for SQL server? We could then go on and merge the first PR while dealing with the licensing issues.

@ctron WDYT? Does that make sense to you as well?

Yes, I'll remove the SQL server parts. Works for me.

@lhotari
Copy link
Contributor Author

lhotari commented Dec 18, 2020

@sophokles73 @ctron I have moved the Postgres specific parts to a new PR, that is #2375 .

- include Microsoft SQLServer driver
- port DDL scripts to SQLServer syntax
   - CREATE TABLE table_name IF NOT EXISTS ->
      IF OBJECT_ID('table_name', 'U') IS NULL
      CREATE TABLE table_name
   - BOOLEAN -> BIT
   - TEXT -> NTEXT (for unicode support)
   - TIMESTAMP -> DATETIME2
   - CHAR/VARCHAR -> NVARCHAR
      - support Unicode
   - char -> varchar to get rid of issues with trailing spaces
- Implement upsert queries for MS SQLServer
  - using MERGE syntax,
    https://docs.microsoft.com/en-us/sql/t-sql/statements/merge-transact-sql
- Test MS SQLServer with Testcontainers
- Use code to accept MS SQL Server Docker image license
  - see https://www.testcontainers.org/modules/databases/mssqlserver/
    for more info

Signed-off-by: Lari Hotari <[email protected]>
@lhotari lhotari changed the title Add MS SQLServer support to JDBC device registry, also test and fix Postgres support in JDBC device registry Add MS SQLServer support to JDBC device registry Jan 7, 2021
@lhotari
Copy link
Contributor Author

lhotari commented Jan 7, 2021

I have rebased the changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants