diff --git a/src/structure.jl b/src/structure.jl index 82bf8ff..3124d60 100644 --- a/src/structure.jl +++ b/src/structure.jl @@ -98,6 +98,15 @@ function Base.setindex!(db::DataBase, table::Table, name::Symbol; verbose = fals flush(db.schema.memory.io) end +function Base.delete!(db::DataBase, name::Symbol) + # File + write(db.schema.memory.io, Action(delete, name), S = db.size) + # In memory + delete!(db.schema.memory.data,name) + # On disk + flush(db.schema.memory.io) +end + function Base.setindex!(tbl::DataBaseTable, object::T, index) where T action = haskey(tbl.memory.data, index) ? modify : create write(tbl.memory.io, Action(action, (index, object)))