我有以下在 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[]