Minijack: Abstract the underlying database operations
This CL introduces Database, Table, Executor, ExecutorFactory.
Database abstracts the underlying database. It now uses sqlite3 as an
implementation. Its main purpose is to get a Table instance.
Table abstracts the behaviors of a database table, like table creation,
row insertion, etc. It controls the database using SQL commands.
Executor hides the underlying database operations, like executing an
SQL query, fetching results, etc.
ExecutorFactory generates Executor objects. It is passed from Database
to Table, such that Table can be generate an executor. It helps separating
Table from the database access.
Check the detailed usages in the unit tests.
Some of the code comes from py/minijack/parser/parser_base.py.
Reviewed-by: Andy Cheng <firstname.lastname@example.org>
Commit-Queue: Tom Wai-Hong Tam <email@example.com>
Tested-by: Tom Wai-Hong Tam <firstname.lastname@example.org>
2 files changed