Experiments in applying Entity-Component-System patterns to durable data storage APIs.
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

try_attach: Optimize to no-op if not changed

moritz.vongoewels.de 4c292271 98ed1e8d

verified
+6 -1
+6 -1
src/entity.rs
··· 119 119 let components = B::to_rusqlite(component)?; 120 120 121 121 let mut stmt = self.0.conn.prepare( 122 - "insert or replace into components (entity, component, data) values (?1, ?2, ?3)", 122 + r#" 123 + insert into components (entity, component, data) 124 + values (?1, ?2, ?3) 125 + on conflict (entity, component) do update 126 + set data = excluded.data where data is not excluded.data; 127 + "#, 123 128 )?; 124 129 125 130 for (component, data) in components {