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

Enhanced update methods #28

Closed
2 of 3 tasks
tejainece opened this issue Jul 6, 2018 · 1 comment
Closed
2 of 3 tasks

Enhanced update methods #28

tejainece opened this issue Jul 6, 2018 · 1 comment

Comments

@tejainece
Copy link
Member

tejainece commented Jul 6, 2018

Implement:

  • updateOnly
  • updateFieldsById
  • updateFields:
  Future<int> updateOnly(User model, Set<String> fields) async {
    // TODO
  }

  Future<int> updateFieldsById(String id, Map<String, dynamic> values) async {
    // TODO
  }

  Future<int> updateFields(
      Expression where, Map<String, dynamic> values) async {
    final st = updater.where(where);
    for (String key in values.keys) {
      final f = fields[key];
      if (f == null) throw Exception('Unknown field!');
      st.set(f, values[key]);
    }
    return execUpdate(st);
  }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant