Uploaded image for project: 'Moodle app'
  1. Moodle app
  2. MOBILE-4210

Fix types in SQLiteDB class

    XMLWordPrintable

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 4.1.0
    • None
    • Others
    • MOODLE_401_STABLE

    Description

      Some types are wrong in SQLiteDB class. A couple of things we detected:

      • The function formatDataToSQLParams has a wrong return type based on the parameter type. The parameter type can probably be changed, because in both cases we call formatDataToInsert before calling it.
      • When using formatDataToInsert we should declare that the type has changed after calling it, probably adding a return in the function with the new type.
      • We could also try to verify that the parameters passed to insert/update match the type in DB. Right now we don't type it, and if you pass a wrong param it will fail. 
      • Related with the previous point, sometimes we declare records with Partial<DBRecord> but that isn't correct because it also makes non-nullable columns optional.

      Attachments

        Activity

          People

            Unassigned Unassigned
            dpalou Dani Palou
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: