Maybe we should move node::db::ConnectionPool into a node_db::pool or node_db::tokio module or similar behind a feature?
It currently feels a bit odd to need to import essential_node just to get access to the connection pool over the DB, which is very specific to the DB.
If you're using essential_node_db, you almost always want the connection pool, but you might not want the relayer streams or whatever else (i.e. like the builder).
So I guess I'm thinking the refactor would look like this:
Move node::db module to node_db::pool and move the rusqlite-pool dependency to node_db.
Feature gate the node_db::pool module and rusqlite-pool dep in case a user just wants the raw sync fns (and doesn't use tokio or whatever).
Re-export node_db::pool::ConnectionPool from node_db (behind feature gate) so that you can use it like node_db::ConnectionPool.
Bonus:
Change essential-node-api to just depend on essential-node-db (won't need the whole essential-node crate anymore).
Possibly re-export essential_node_db as db in essential-node to emulate the existing behaviour (e.g. this would allow essential_node::db::ConnectionPool to still be available).
From slack discussion:
Maybe we should move
node::db::ConnectionPool
into anode_db::pool
ornode_db::tokio
module or similar behind a feature?It currently feels a bit odd to need to import
essential_node
just to get access to the connection pool over the DB, which is very specific to the DB.If you're using
essential_node_db
, you almost always want the connection pool, but you might not want the relayer streams or whatever else (i.e. like the builder).So I guess I'm thinking the refactor would look like this:
node::db
module tonode_db::pool
and move therusqlite-pool
dependency tonode_db
.node_db::pool
module andrusqlite-pool
dep in case a user just wants the raw sync fns (and doesn't use tokio or whatever).node_db::pool::ConnectionPool
fromnode_db
(behind feature gate) so that you can use it likenode_db::ConnectionPool
.Bonus:
essential-node-api
to just depend onessential-node-db
(won't need the whole essential-node crate anymore).essential_node::db::ConnectionPool
to still be available).