Exposed icon indicating copy to clipboard operation
Exposed copied to clipboard

Use concat when strings are added

Open AliLozano opened this issue 4 years ago • 6 comments

I get this error when I try to update with a plus concatenation:

org.jetbrains.exposed.exceptions.ExposedSQLException: org.h2.jdbc.JdbcSQLFeatureNotSupportedException: Caracteristica no soportada: "VARCHAR +" Feature not supported: "VARCHAR +"; S

The code to test is this:

        Country.update {
           with(SqlExpressionBuilder) {
               it[name] = name + "ABC"
           }
        }

I think that Strings should concat by default.

AliLozano avatar Mar 08 '20 21:03 AliLozano

Hi @Tapac, I've added other two functions and created the test.

AliLozano avatar Mar 14 '20 16:03 AliLozano

Looks like your test fails on PostgreSQL (https://teamcity.jetbrains.com/viewType.html?buildTypeId=Exposed_PullRequests&branch_Exposed=830%2Fmerge)

Tapac avatar Mar 15 '20 15:03 Tapac

I don't understand why, and I don't know yet how to run tests with all drivers, can you help me?.

AliLozano avatar Mar 16 '20 03:03 AliLozano

Base tests (H2,SQLite,MySQL,PostgreSQL) run with simple gradle :exposed-tests test If you desire to test SQLServer, Oracle, MariaDB or MySQL 8.0 you have to adjust dialect value in gradle.properties and execute gradle :exposed-tests exposedDialectTestWithDocker

Tapac avatar Mar 17 '20 12:03 Tapac

@AliLozano you could check https://github.com/JetBrains/Exposed/wiki/Contributing#how-to-contibute on how to run tests

Tapac avatar Apr 13 '20 18:04 Tapac

@Tapac thanks for the information, I will check it this week, and update my pull request. 😁

AliLozano avatar Apr 14 '20 16:04 AliLozano

Hey @AliLozano, I failed to push the PR into your branch, so I recreated the PR here: https://github.com/JetBrains/Exposed/pull/1958. I will rebease it and fix the test

Thanks for the contribution!

e5l avatar Jan 04 '24 12:01 e5l