Don't needlessly copy all the records.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
This commit is contained in:
parent
b78eeba4c9
commit
455acb833c
1 changed files with 3 additions and 3 deletions
6
newfol
6
newfol
|
|
@ -1012,12 +1012,12 @@ def import_into(db, dtbname, dbtype, minfields=0, strict=False, identity=False):
|
||||||
|
|
||||||
def export_from(db, table, dbtype):
|
def export_from(db, table, dbtype):
|
||||||
vault = filemanip.FileStorage(dbtype, sys.stdout)
|
vault = filemanip.FileStorage(dbtype, sys.stdout)
|
||||||
recs = db.records()
|
f = lambda x: True
|
||||||
if table is None and dbtype == "csv":
|
if table is None and dbtype == "csv":
|
||||||
raise newfol.exception.NewfolError("A table is required for csv")
|
raise newfol.exception.NewfolError("A table is required for csv")
|
||||||
if table is not None:
|
if table is not None:
|
||||||
recs = db.records(lambda x: x.table == table)
|
f = lambda x: x.table == table
|
||||||
vault.store(recs)
|
vault.store(db.records(f))
|
||||||
|
|
||||||
def parse_args(args):
|
def parse_args(args):
|
||||||
parser = argparse.ArgumentParser(description="store and manipulate fol")
|
parser = argparse.ArgumentParser(description="store and manipulate fol")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue