add way to delete table
parent
13fd78ed1d
commit
aff95b794e
|
@ -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)))
|
||||
|
|
Loading…
Reference in New Issue