是否可以将 postgresql 数组重叠运算符 (&&) 与 Dapper 一起使用

问题描述 投票:0回答:0

我有以下在 postgres 中有效的查询:

SELECT name FROM people
WHERE ARRAY['john', 'sue'] && (name) 

然而,当我尝试通过 dapper 复制它时,出现以下错误:

Npgsql.PostgresException: '42883: operator does not exist: record && text[]

传递给

QueryAsync
的 sql dapper 是:

SELECT name FROM people
WHERE @name && (name)

其中@name 是

DynamicParameter
类型
string[]
包含“John”和“Sue”

我想知道是否有人对此有解决方案,或者这是不可能的,谢谢。

我也试过用

ARRAY[]

包装参数
WHERE ARRAY[@name] && (name)

这也不起作用并导致错误

Npgsql.PostgresException: '42883: operator does not exist: record[] && text[]

c# postgresql dapper
© www.soinside.com 2019 - 2024. All rights reserved.