« first day (1744 days earlier)      last day (2574 days later) » 

2:51 AM
hey guys!
 
 
14 hours later…
4:36 PM
Tis quiet here, but I'll throw it out there. In SQLite, when inserting a row, will the conflict resolution 'replace' insert to the same rowid, or will it create a new one?
 
it will overwrite the current line, that's replacing...
 
Thanks, the documentation doesn't make that clear: sqlite.org/conflict.html
 
You'Re welcome
 
 
1 hour later…
6:02 PM
@Myonara Assumption is the mother of all f*&kups.
 
what has happened?
 
It returns a new rowid.
* I asked earlier about 'replace' in sqlite...
 
oh. but the data of that line is replaced or do you have no primary/unique constraint, which is matching the insert or replace-command?
I always tried to avoid using the rowid in sql databases, as there were internal and mostly inpredictable.
 
there is a unique constraint:
CREATE TABLE tags (tag TEXT PRIMARY KEY ON CONFLICT REPLACE)
As per the sqlite docs however, it's actually encouraged to use rowid: sqlite.org/autoinc.html
 
ok. and the other line data for that tag was replaced?
 
6:09 PM
removed
 
but there was a new line with the same tag?
 
I guess it's faster for the DB to create a new one, that way it can write in bigger block sizes
yeah same tag, different rowid
old rowid no longer exists
 
Ok, understood. Didn't know that. Thank you for clarification.
 
Or maybe it still does actually, but both rowid's point to the same row... not sure, will have to check again, gtg...
 

« first day (1744 days earlier)      last day (2574 days later) »