early database code