You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
create function code__search(p_lang_code text, p_search_text text, p_type_ids integer[])
returns TABLE(id bigint, name text)
language sql
as
...
Code Sample for calling function:
public async Task SearchCodes(string langCode, int pageNumber, int pageSize, string searchText, List<int> typeIds,
CancellationToken cancellationToken)
{
var query = GetSqlKataQuery()
.FromRaw($"public.code__search(?,?,?)", langCode, searchText, typeIds)
.OrderByRaw("[lower] (name)")
.Skip(pageNumber * pageSize)
.Take(pageSize);
using var cmd = await GetSqlCommandAsync(query, cancellationToken);
{
await cmd.ExecuteReaderAsync<DtoItemWithName<long>>(cancellationToken);
}
}
calling function throws error: function public.code__search(text, unknown, integer[], integer) does not exist.
Generated Sql: SELECT * FROM public.code__search(?,?,?,?) ORDER BY "lower" (name) LIMIT ? OFFSET ?
RawSql: SELECT * FROM public.code__search(@p0,@p1,@p2,@p3) ORDER BY "lower" (name) LIMIT @p4 OFFSET @p5
SqlResult retured from PostgresCompilerCompile method:
FromRaw take params object[] bindings as second parameter and can't translate List<int> as separate parameter for postgres function.
is there any way to call function like this? it needs method something like AddParameter to pass parameters in query or some type of support for calling functions and procedures
The text was updated successfully, but these errors were encountered:
Dabatase: Postgres
Function body sample:
Code Sample for calling function:
calling function throws error:
function public.code__search(text, unknown, integer[], integer) does not exist
.Generated Sql:
SELECT * FROM public.code__search(?,?,?,?) ORDER BY "lower" (name) LIMIT ? OFFSET ?
RawSql:
SELECT * FROM public.code__search(@p0,@p1,@p2,@p3) ORDER BY "lower" (name) LIMIT @p4 OFFSET @p5
SqlResult retured from
PostgresCompiler
Compile
method:FromRaw take
params object[] bindings
as second parameter and can't translateList<int>
as separate parameter for postgres function.is there any way to call function like this? it needs method something like
AddParameter
to pass parameters in query or some type of support for calling functions and proceduresThe text was updated successfully, but these errors were encountered: