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/

TEST=make test

Change-Id: I6b0309025781ab1f4cae48fbc9260ac16cd6926c
Reviewed-by: Andy Cheng <>
Commit-Queue: Tom Wai-Hong Tam <>
Tested-by: Tom Wai-Hong Tam <>
2 files changed