0 votes
270 views
asked Apr 11, 2019 by anonymous | 270 views

1 Answer

+1 vote
Best answer

The latest version of the Data Lab client package contains a "mydb_rename(<old>,<new>)" method in the queryClient to rename tables.  For example,

>>> from dl import queryClient as qc
>>> print(qc.list())
test
>>> qc.mydb_rename('test','foo')
'OK'
>>> print(qc.list())
foo

 

You can install the package using 'pip' with:

    pip install --upgrade noaodatalab

See also http://github.com/noaodatalab/datalab

answered Apr 11, 2019 by datalab (19,200 points)
And when you have the datalab package installed, you can also do the rename from the CMD line (after logging in):

datalab mydb_rename old=test new=foo

359 questions

372 answers

385 comments

2,427 users

Welcome to Data Lab Help Desk, where you can ask questions and receive answers from other members of the community.