# Path: scripts/civ5/databases.py
# class DatabaseAdapter(object):
#     def __init__(self, filepath):
#         self.filepath = filepath
#         self.conn = sqlite3.connect(filepath)
#         self.conn.row_factory = sqlite3.Row
# 
#     def __del__(self):
#         self.close()
# 
#     def close(self):
#         self.conn.close()


from .databases import DatabaseAdapter
        type TEXT
    )
'''
INSERT_POLICIES_SQL = '''
    INSERT INTO policy
        (_id, name, help, civilopedia, sort_order, type)
    VALUES(:_id, :name, :help, :civilopedia, :sort_order, :type)
'''

CREATE_SQLS = (
    SQL_CREATE_METADATA,
    CREATE_TECHNOLOGIES_SQL,
    CREATE_UNITS_SQL,
    CREATE_BUILDINGS_SQL,
    CREATE_WONDERS_SQL,
    CREATE_RELIGION_SQL,
    CREATE_POLICIES_SQL,
)

INSERT_SQLS = (
    ('technology', INSERT_TECHNOLOGIES_SQL),
    ('units', INSERT_UNITS_SQL),
    ('buildings', INSERT_BUILDINGS_SQL),
    ('wonders', INSERT_WONDERS_SQL),
    ('religion', INSERT_RELIGION_SQL),
    ('policies', INSERT_POLICIES_SQL),
)


def write_database(filepath, data):

# Path: scripts/civ5/databases.py
# class DatabaseAdapter(object):
#     def __init__(self, filepath):
#         self.filepath = filepath
#         self.conn = sqlite3.connect(filepath)
#         self.conn.row_factory = sqlite3.Row
# 
#     def __del__(self):
#         self.close()
# 
#     def close(self):
#         self.conn.close()


# Path: scripts/civ5/utils.py
from .databases import DatabaseAdapter

        type TEXT
    )
'''
INSERT_POLICIES_SQL = '''
    INSERT INTO policy
        (_id, name, help, civilopedia, sort_order, type)
    VALUES(:_id, :name, :help, :civilopedia, :sort_order, :type)
'''

CREATE_SQLS = (
    SQL_CREATE_METADATA,
    CREATE_TECHNOLOGIES_SQL,
    CREATE_UNITS_SQL,
    CREATE_BUILDINGS_SQL,
    CREATE_WONDERS_SQL,
    CREATE_RELIGION_SQL,
    CREATE_POLICIES_SQL,
)

INSERT_SQLS = (
    ('technology', INSERT_TECHNOLOGIES_SQL),
    ('units', INSERT_UNITS_SQL),
    ('buildings', INSERT_BUILDINGS_SQL),
    ('wonders', INSERT_WONDERS_SQL),
    ('religion', INSERT_RELIGION_SQL),
    ('policies', INSERT_POLICIES_SQL),
)


def write_database(filepath, data):

    db = DatabaseAdapter(filepath)