thehubbleproject / hubble-contracts

Hubble optimistic rollup
https://thehubbleproject.github.io/docs/
MIT License
133 stars 28 forks source link

parameterize construction of database connection #666

Open kautukkundan opened 2 years ago

kautukkundan commented 2 years ago

Problem

Currently database objects are simply created at a fixed location and passed on to all the consumers directly. This also creates overlapping of read operations especially in the case when multiple storage managers access the database in the same context (see client/integration.test.ts)

Solution

create a factory pattern for database connections which can be modified according to context