mirror of
				https://github.com/isar/rusqlite.git
				synced 2025-10-30 13:28:56 +08:00 
			
		
		
		
	Add a function to return the path of a Connection (#963)
This commit is contained in:
		
							
								
								
									
										10
									
								
								src/lib.rs
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								src/lib.rs
									
									
									
									
									
								
							| @@ -537,6 +537,16 @@ impl Connection { | ||||
|             .and_then(|mut stmt| stmt.check_no_tail().and_then(|_| stmt.execute(params))) | ||||
|     } | ||||
|  | ||||
|     /// Returns the path to the database file, if one exists and is known. | ||||
|     /// | ||||
|     /// Note that in some cases [PRAGMA | ||||
|     /// database_list](https://sqlite.org/pragma.html#pragma_database_list) is | ||||
|     /// likely to be more robust. | ||||
|     #[inline] | ||||
|     pub fn path(&self) -> Option<&Path> { | ||||
|         self.path.as_deref() | ||||
|     } | ||||
|  | ||||
|     /// Convenience method to prepare and execute a single SQL statement with | ||||
|     /// named parameter(s). | ||||
|     /// | ||||
|   | ||||
		Reference in New Issue
	
	Block a user