awslabs / aws-shell

An integrated shell for working with the AWS CLI.
Apache License 2.0
7.17k stars 772 forks source link

Switch to sqlite3 backend for doc index #24

Closed jamesls closed 8 years ago

jamesls commented 8 years ago

Better cross platform support. There was some complexity in getting this to work, namely that you can't share connection across different threads (even if you use your own locking). The sqlite3 python lib raises an error.

See https://docs.python.org/2/library/sqlite3.html#multithreading for more info.

This is also slightly slower than before because each __setitem__ call happens in a sqlite transaction. This is needed to ensure that the sqlite connection in the main thread (that runs the aws-shell loop) can actually see the doc index updates being added incrementally.

donnemartin commented 8 years ago

Looks good! :shipit:

jamesls commented 8 years ago

Merged via 84cc2b793b049a6212b239ea3da023f1573f3caf