mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-25 12:04:21 +01:00
closes #977 In order to properly get #960 merged and keep some sort of the same API we have now, we need to support URIs/query parameters for opening new databases. This PR doesn't attempt to implement anything useful with this, it only handles parsing, but it will allow #960 to properly open a new file with a specific VFS without having to entirely re-design the `open_file` method/API. The existing option in that PR right now is less than ideal. e.g. All of the existing methods already accept an `IO` impl ```rust pub fn open_file(io: Arc<dyn IO>, path: &str) -> Result<Arc<Database>> { // or pub fn open( io: Arc<dyn IO>, page_io: Rc<dyn DatabaseStorage>, wal: Rc<RefCell<dyn Wal>>, shared_wal: Arc<RwLock<WalFileShared>>, buffer_pool: Rc<BufferPool>, ) -> Result<Arc<Database>> { ``` Right now, most of the parsed query parameters are not options we support yet, but I figured it's better to handle parsing them now and using them later on when we support them. Also, if this looks way overly complicated for what it does... that's because the cross platform edge-cases are a super pain in the ass. Closes #1039