Last active
May 2, 2019 12:34
-
-
Save miskolc/fc3f1b44f8ea8cb7467dbf363077175e to your computer and use it in GitHub Desktop.
sqlite export data labels
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo docker volume ls | |
DRIVER VOLUME NAME | |
local ubuntu | |
ubuntu@ip-10-6-40-184:~$ sudo docker volume inspect | |
"docker volume inspect" requires at least 1 argument. | |
See 'docker volume inspect --help'. | |
Usage: docker volume inspect [OPTIONS] VOLUME [VOLUME...] | |
Display detailed information on one or more volumes | |
ubuntu@ip-10-6-40-184:~$ sudo docker volume inspect ubuntu | |
[ | |
{ | |
"CreatedAt": "2019-05-02T11:28:08Z", | |
"Driver": "local", | |
"Labels": {}, | |
"Mountpoint": "/var/lib/docker/volumes/ubuntu/_data", | |
"Name": "ubuntu", | |
"Options": {}, | |
"Scope": "local" | |
} | |
] | |
ubuntu@ip-10-6-40-184:~$ ls /var/lib/docker/volumes/ubuntu/_data | |
ls: cannot access '/var/lib/docker/volumes/ubuntu/_data': Permission denied | |
ubuntu@ip-10-6-40-184:~$ sudo ls /var/lib/docker/volumes/ubuntu/_data | |
app requirements.txt tools | |
ubuntu@ip-10-6-40-184:~$ sudo ls /var/lib/docker/volumes/ubuntu/_data/app | |
__init__.py app classifier db.sqlite3 manage.py server staticfiles | |
ubuntu@ip-10-6-40-184:~$ sqlite3 | |
Command 'sqlite3' not found, but can be installed with: | |
sudo apt install sqlite3 | |
ubuntu@ip-10-6-40-184:~$ sudo apt install sqlite3 | |
Reading package lists... Done | |
Building dependency tree | |
Reading state information... Done | |
Suggested packages: | |
sqlite3-doc | |
The following NEW packages will be installed: | |
sqlite3 | |
0 upgraded, 1 newly installed, 0 to remove and 74 not upgraded. | |
Need to get 751 kB of archives. | |
After this operation, 2477 kB of additional disk space will be used. | |
Get:1 http://eu-central-1.ec2.archive.ubuntu.com/ubuntu bionic/main amd64 sqlite3 amd64 3.22.0-1 [751 kB] | |
Fetched 751 kB in 0s (55.2 MB/s) | |
Selecting previously unselected package sqlite3. | |
(Reading database ... 84398 files and directories currently installed.) | |
Preparing to unpack .../sqlite3_3.22.0-1_amd64.deb ... | |
Unpacking sqlite3 (3.22.0-1) ... | |
Setting up sqlite3 (3.22.0-1) ... | |
Processing triggers for man-db (2.8.3-2ubuntu0.1) ... | |
ubuntu@ip-10-6-40-184:~$ sqlite3 | |
Negative values right-justify | |
sqlite> .show | |
echo: off | |
eqp: off | |
explain: auto | |
headers: off | |
mode: list | |
nullvalue: "" | |
output: stdout | |
colseparator: "|" | |
rowseparator: "\n" | |
stats: off | |
width: | |
filename: :memory: | |
sqlite> .tables | |
sqlite> .exit | |
ubuntu@ip-10-6-40-184:~$ sudo docker inspect volume ubuntu | |
[ | |
{ | |
"CreatedAt": "2019-05-02T11:28:08Z", | |
"Driver": "local", | |
"Labels": {}, | |
"Mountpoint": "/var/lib/docker/volumes/ubuntu/_data", | |
"Name": "ubuntu", | |
"Options": {}, | |
"Scope": "local" | |
} | |
] | |
Error: No such object: volume | |
ubuntu@ip-10-6-40-184:~$ sudo ls /var/lib/docker/volumes/ubuntu/_data | |
app requirements.txt tools | |
ubuntu@ip-10-6-40-184:~$ sudo su | |
root@ip-10-6-40-184:/home/ubuntu# ls /var/lib/docker/volumes/ubuntu/_data/app/ | |
__init__.py app classifier db.sqlite3 manage.py server staticfiles | |
root@ip-10-6-40-184:/home/ubuntu# sqlite3 -header -csv /var/lib/docker/volumes/ubuntu/_data/app/db.sqlite3 "SELECT * FROM labels;" > labels.csv | |
Error: no such table: labels | |
root@ip-10-6-40-184:/home/ubuntu# sqlite3 | |
SQLite version 3.22.0 2018-01-22 18:45:57 | |
Enter ".help" for usage hints. | |
Connected to a transient in-memory database. | |
Use ".open FILENAME" to reopen on a persistent database. | |
sqlite> .open "/var/lib/docker/volumes/ubuntu/_data/app/db.sqlite3" | |
sqlite> .tables | |
auth_group server_project | |
auth_group_permissions server_project_users | |
auth_permission server_seq2seqannotation | |
auth_user server_seq2seqproject | |
auth_user_groups server_sequenceannotation | |
auth_user_user_permissions server_sequencelabelingproject | |
django_admin_log server_textclassificationproject | |
django_content_type social_auth_association | |
django_migrations social_auth_code | |
django_session social_auth_nonce | |
server_document social_auth_partial | |
server_documentannotation social_auth_usersocialauth | |
server_label | |
sqlite> SELECT * FROM server_label LIMIT 10 | |
...> | |
...> ; | |
1|One|||#209cee|#ffffff|2019-05-02 12:13:36.347318|2019-05-02 12:13:36.347343|1 | |
sqlite> SELECT * FROM server_project LIMIT 10 | |
...> ; | |
1|French Language|French|Please write annotation guideline.|2019-05-02 12:01:34.263248|2019-05-02 12:01:34.263276|DocumentClassification|15 | |
sqlite> .exit | |
root@ip-10-6-40-184:/home/ubuntu# sqlite3 -header -csv /var/lib/docker/volumes/ubuntu/_data/app/db.sqlite3 "SELECT * FROM server_label;" > labels.csv | |
root@ip-10-6-40-184:/home/ubuntu# ls | |
doccano labels.csv | |
root@ip-10-6-40-184:/home/ubuntu# |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment