Skip to content
This repository has been archived by the owner on Dec 13, 2023. It is now read-only.

IN collection clause doesn't work #238

Open
pillowbalcony opened this issue Jun 24, 2022 · 1 comment
Open

IN collection clause doesn't work #238

pillowbalcony opened this issue Jun 24, 2022 · 1 comment

Comments

@pillowbalcony
Copy link

Hi, I'm working on a sql using operator IN:

Mono<List<Map<String, Object>>> result = databaseClient.sql("select * from users where id in (?)")
                .bind(0, new Integer[] {1, 2, 3})
                .map(this::mapRowData)
                .all()
                .collectList();

However it gets an error during execution:

java.lang.IllegalArgumentException: Cannot encode value of type 'class [Ljava.lang.Integer;'

	at dev.miku.r2dbc.mysql.codec.DefaultCodecs.encode(DefaultCodecs.java:178)
	at dev.miku.r2dbc.mysql.ParametrizedStatementSupport.bind(ParametrizedStatementSupport.java:72)
	at dev.miku.r2dbc.mysql.ParametrizedStatementSupport.bind(ParametrizedStatementSupport.java:39)
	at org.springframework.r2dbc.core.DefaultDatabaseClient$DefaultGenericExecuteSpec.lambda$bindByIndex$6(DefaultDatabaseClient.java:442)
... 
rest omitted

I checked the whole codec list and can not find a codec supporting this clause.

@subrata71
Copy link

Queries with IN clauses are widely used. It's time MySQL r2dbc driver had support for this.

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

No branches or pull requests

2 participants