Skip to content

Commit

Permalink
add method to delete bcolz dbs
Browse files Browse the repository at this point in the history
  • Loading branch information
schae234 committed May 17, 2019
1 parent a752bd5 commit 0d5d137
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions minus80/Freezable.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

from .Config import cf
from contextlib import contextmanager
from shutil import rmtree as rmdir

try:
import apsw as lite
Expand Down Expand Up @@ -211,11 +212,29 @@ def _sqlite(self):
filename = os.path.join(self._get_dbpath('db.sqlite'))
return lite.Connection(filename)

def _bcolz_remove(self,name):
'''
Remove a bcolz array from disk
'''
path = os.path.join(self._get_dbpath('bcz'),name)
if not os.path.exists(path):
raise ValueError(f'{name} does not exist')
else:
rmdir(path)

def _bcolz_list(self):
'''
List the available bcolz datasets
'''
return os.listdir(self._get_dbpath('bcz'))


def _bcolz_array(self, name, array=None, m80name=None,
m80type=None):
'''
Routines to set/get arrays from the bcolz store
'''

# Fill in the defaults if they were not provided
if m80type is None:
m80type = self._m80_dtype
Expand Down

0 comments on commit 0d5d137

Please sign in to comment.