Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG/Feature Request] Unable to create OR sql-statement-like query using Conduit #193

Open
RamenC opened this issue Feb 22, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@RamenC
Copy link

RamenC commented Feb 22, 2023

Describe the bug
Unable to create OR statement like query using conduit

To Reproduce

  1. Create a fresh instance of Postgresql DB or use existing ones.
  2. Connect conduit to the DB
  3. Create the necessary schemas.
  4. Create a class that extends ResourceController and perform a query that uses multiple properties e.g.
@Operation.get()
  Future<Response> getAllEmployee({
    @Bind.query('input') String? input,
    }) async {
    final query = Query<Employee>(context!);
    query.where((x) => x.name.contains(input) || x.familyName.contains(input)).equalsTo(true);
    final employeeList = await query.fetch();
   return Response.ok(employeeList);
    }

Error message

Invalid argument(s): Invalid property selector. Must reference a single property only
#0      QueryMixin.where (package:conduit_core/src/db/query/mixin.dart:75:7)

Expected behavior
Return a table where either the Employee name or family name contains the input string given.

System Information:

  • OS: Windows 10
  • Dart Version: 2.19
  • Conduit Version: 4.3.6
@RamenC RamenC added the bug Something isn't working label Feb 22, 2023
@jeffscaturro-aka
Copy link

+1 support for an OR statement would be highly useful and beneficial.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants