Maybe inside this function, there was something that I could tweak. ** insert into TABLE (IDLIST) default values ** insert into TABLE (IDLIST) values(EXPRLIST),(EXPRLIST). Above the function signature, we see: ** This routine is called to handle SQL of the following forms: If you skim through all function implementation you'll probably hit sqlite3Insert. I decided to jump straight to the insert.c file to see if I could find something interesting there. If you're somewhat familiar with how databases work you can probably imagine what some files are responsible for. I've cloned SQLite source code using fossil and started navigating the files structure. But it turns out this time was different. So I thought it would be just one of those times of opening a C language file and giving up minutes later. I have always felt intimidated by reading C language code. So, I decided to dig deeper into the source code to see if there could be a world where I would understand it, and not only that, I could actually make some changes to it to provide what I was hoping for. ![]() There are probably plenty of approaches to how I could build such a tree, but as far as I'm concerned, the SQLite API does not offer what I was exactly looking for. I would just get the driver's representation of that row. And even with that approach, I would still not get the raw bytes of the row record. That means I would have to fetch all the columns for the rows inside the column. The issue with that API is that it only returns the rowid of the row. The closest API that SQLite offers to what I was looking for is the sqlite3_update_hook: The sqlite3_update_hook() interface registers a callback function with the database connection identified by the first argument to be invoked whenever a row is updated, inserted or deleted in a rowid table. The motivation for that is that I wanted to create a hash of that row, essentially, to be able to build a Merkle Tree of the corresponding table as rows get inserted or updated. ![]() The other day, I was thinking about how I could get the bytes of a record of a recently inserted or updated row in SQLite.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |