diff --git a/Transacting:-entity-to-SQL-translation.md b/Transacting:-entity-to-SQL-translation.md index 787a459..aabf894 100644 --- a/Transacting:-entity-to-SQL-translation.md +++ b/Transacting:-entity-to-SQL-translation.md @@ -104,24 +104,25 @@ We handle a few entity types specially. * `[:db/retractAttribute e a]`: - We have SQLite insert into `after_search` roughly as follows: - ```sql +We have SQLite insert into `after_search` roughly as follows: +```sql INSERT INTO after_search SELECT e, a, v, value_type_tag, RETRACTED, EXACT_MATCH, rowid, v, value_type_tag FROM datoms WHERE e = :e AND a = :a - ``` +``` * `[:db/retractEntity e]`: - We have SQLite insert into `after_search` as follows: - ```sql +We have SQLite insert into `after_search` as follows: +```sql INSERT INTO after_search SELECT e, a, v, value_type_tag, RETRACTED, EXACT_MATCH, rowid, v, value_type_tag FROM datoms WHERE e = :e OR (v = :e AND value_type_tag = REF) ``` - It would be possible to generalize the search step above to do this search as part of the main search, but it's likely to be less efficient. + +It would be possible to generalize the search step above to do this search as part of the main search, but it's likely to be less efficient. ## Updating the transactions and datoms tables