dbcli / litecli

CLI for SQLite Databases with auto-completion and syntax highlighting
https://litecli.com
BSD 3-Clause "New" or "Revised" License
2.52k stars 74 forks source link

'str' object has no attribute 'parent' #125

Closed oolonc closed 2 years ago

oolonc commented 2 years ago

Hello,

I am having some strange difficulty running this simple select:

root@1ec13901c7a7:/# litecli /tmp/out.db
Version: 1.6.0
Mail: https://groups.google.com/forum/#!forum/litecli-users
GitHub: https://github.com/dbcli/litecli
/tmp/out.db> select * from sqlite_master;
'str' object has no attribute 'parent'
/tmp/out.db>

This is strange because this same select executed like so seems to work:

root@1ec13901c7a7:/# litecli -e 'SELECT * FROM SQLITE_MASTER;' /tmp/out.db
type    name    tbl_name        rootpage        sql
table   test_table      test_table      2       CREATE TABLE "test_table"(\n  "Year" TEXT,\n  "Industry_aggregation_NZSIOC" TEXT,\n  "Industry_code_NZSIOC" TEXT,\n  "Industry_name_NZSIOC" TEXT,\n  "Units" TEXT,\n  "Variable_code" TEXT,\n  "Variable_name" TEXT,\n  "Variable_category" TEXT,\n  "Value" TEXT,\n  "Industry_code_ANZSIC06" TEXT\n)

However, if use the -t flag I get the original error:

root@1ec13901c7a7:/# litecli -t -e 'SELECT * FROM SQLITE_MASTER;' /tmp/out.db
'str' object has no attribute 'parent'
root@1ec13901c7a7:/#

I'm inside of python:3.9 Docker container for these commands, but also see the error on my local machine. Any tips would be appreciated.

Thanks!

### Version Info ``` root@1ec13901c7a7:/# python --version Python 3.9.9 root@1ec13901c7a7:/# litecli --version Version: 1.6.0 ``` ### `pip list` ``` root@1ec13901c7a7:/# pip list Package Version -------------- ------- cli-helpers 2.2.0 click 8.0.3 configobj 5.0.6 litecli 1.6.0 pip 21.2.4 prompt-toolkit 3.0.24 Pygments 2.11.2 setuptools 57.5.0 six 1.16.0 sqlparse 0.4.2 tabulate 0.8.9 wcwidth 0.2.5 wheel 0.37.0 ```
amjith commented 2 years ago

Yup. There is a new Pygments release that is causing some issues. If you're familiar with pip you can do pip install pygments==2.11.1.

I'll try and release a patch for this later today. Sorry about the inconvenience.

oolonc commented 2 years ago

That worked perfectly, thank you! And thank you for this very excellent tool!