ryanfowler / async-sqlite

A Rust library to interact with sqlite from an async context.
MIT License
7 stars 4 forks source link

Pool + `conn.create_scalar_function` #12

Open jessekrubin opened 1 month ago

jessekrubin commented 1 month ago

Creating/registering sqlite functions/extensions with Pool only registers for one connection.

jessekrubin commented 1 month ago

@ryanfowler this problemo extends to attach as well so attaching from a pool only attaches on one client.

ryanfowler commented 1 month ago

Yeah, one of the problems with Pool right now is that you can't run a change on all connections in the pool. I'll need to add a method to Pool that does that. Something like an all method that takes an Fn that it applies to every connection in the pool.

I'll hopefully have some time soon to work on that

jessekrubin commented 1 month ago

@ryanfowler I would be happy to give it a go (if I have the time soon).

BTW If you wanna see your lib in the wild, you can checkout this: https://github.com/jessekrubin/utiles/blob/main/crates/utiles/src/sqlite/async_sqlite3.rs and https://github.com/jessekrubin/utiles/blob/main/crates/utiles/src/utilesqlite/mbtiles_async_sqlite.rs -- Any thoughts/ideas appreciated!

ryanfowler commented 1 month ago

That would be great!