Add some api for handling SQLite3 migrations

Review Request #1906 — Created Oct. 7, 2022 and submitted

Information

pidgin/pidgin
default

Reviewers

Also port the SqliteHistoryAdapter to the new api.

Ran the unit tests under valgrind and checked out code coverage which is really just missing error handling I can't test.

Summary ID
Add some api for handling SQLite3 migrations
Also port the SqliteHistoryAdapter to the new api.
7c39089da3afc2bc0090629e37ccb5eaf083eb70
Description From Last Updated

An

QuLogicQuLogic

I thought we didn't put (out) on errors because it did nothing.

QuLogicQuLogic

its

QuLogicQuLogic

There's a word or something missing at the beginning of this sentence. I also don't understand what you mean by …

QuLogicQuLogic

creates

QuLogicQuLogic

its

QuLogicQuLogic

s/is to be/to be/

QuLogicQuLogic

s/Which of course/This/

QuLogicQuLogic

Since the transaction is deferred, is there really no chance of an error in the COMMIT?

QuLogicQuLogic

I don't know what 'pretend write' means here.

QuLogicQuLogic

OK, I do know why you do i+1, but this comment is confusing because it doesn't have anything to do …

QuLogicQuLogic
QuLogic
  1. 
      
  2. libpurple/purplesqlite3.h (Diff revision 1)
     
     
  3. libpurple/purplesqlite3.h (Diff revision 1)
     
     

    I thought we didn't put (out) on errors because it did nothing.

    1. What do you mean by "it did nothing" ?

    2. It didn't affect the docs (and possibly not even the gir) because errors are special-cased.

    3. Ah gotcha, I forgot about that!

  4. libpurple/purplesqlite3.h (Diff revision 1)
     
     
  5. libpurple/purplesqlite3.h (Diff revision 1)
     
     

    There's a word or something missing at the beginning of this sentence.

    I also don't understand what you mean by a "full" migration, as it seems like the second entry in the below example is a "partial" schema since it only contains 1->2 changes, but then it's still an incremental migration for each step, and not a full one, unless full has some specific DB meaning.

    Also, since you begin a transaction around the migration, you may want to mention not needing that here.

  6. libpurple/purplesqlite3.h (Diff revision 1)
     
     

    s/is to be/to be/

  7. libpurple/purplesqlite3.h (Diff revision 1)
     
     

    s/Which of course/This/

  8. libpurple/purplesqlite3.c (Diff revision 1)
     
     

    Since the transaction is deferred, is there really no chance of an error in the COMMIT?

  9. libpurple/purplesqlite3.c (Diff revision 1)
     
     

    I don't know what 'pretend write' means here.

  10. 
      
grim
grim
grim
QuLogic
  1. 
      
  2. libpurple/purplesqlite3.h (Diff revisions 1 - 2)
     
     

    creates

  3. libpurple/purplesqlite3.h (Diff revisions 1 - 2)
     
     
  4. libpurple/purplesqlite3.c (Diff revisions 1 - 2)
     
     
     
     
     
     

    OK, I do know why you do i+1, but this comment is confusing because it doesn't have anything to do with short circuiting the for loop. The for loop checks migrations[i], and version doesn't even exist as part of the loop condition.

  5. 
      
grim
QuLogic
  1. Ship It!
  2. 
      
grim
Review request changed

Status: Closed (submitted)

Loading...